#include <stdio.h>


int main (){
  
  unsigned n; 
  int broj=0, os, os2, novi, i ;
  
      scanf ("%d", &n);
      
      for (i=1; n!=0; i=i*10)
      {
	os=n%10;
	novi=n/10;
	os2=novi%10;
	n=n/10; 
	if(os==os2)
	  broj=os2*i+broj;
	else i=1;
      }
      
      printf("%d /n", broj);
  
  
  return 0;
  
}