semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
    char ch[6];
    char c;
    int j,k,n=0;
    do
    {
         n++;
         ch[n-1]=getchar();
    }while(ch[n-1]!='\n');
    n--;
    for(j=0;j<n/2;j++)
    {
        c=ch[j];
        ch[j]=ch[n-1-j];
        ch[n-1-j]=c;
    }
    for(k=0;k<n;k++)
       putchar(ch[k]);
    return 0;
}
int main(){
 int x,y; 
    y=0; 
    scanf("%d",&x); 
    while(x>9){ 
      y=(y+x-x/10*10)*10; 
      x=x/10; 
    } 
    y=y+x; 
    printf("%d\n",y);
}
void main ()
{
char a, b, c, d, e;
a=getchar();
b=getchar();
c=getchar();
d=getchar();
e=getchar();
if(e>='0'&&e<='9')
{putchar(e);putchar(d);putchar(c);putchar(b);putchar(a);}
else if(!(e>='0'&&e<='9'))
{
	if(d>='0'&&d<='9')
    {putchar(d);putchar(c);putchar(b);putchar(a);}
	else if(!(d>='0'&&d<='9'))
	{
		if(c>='0'&&c<='9')
		{putchar(c);putchar(b);putchar(a);}
		else if(!(c>='0'&&c<='9'))
		{
			if(b>='0'&&b<='9')
			{putchar(b);putchar(a);}
			else if(!(b>='0'&&b<='9'))
				putchar(a);
		}
	}
}
}
char a[6];
int i,j;
void replace(int i,int j)
{
	int temp;
	if(i<j)
	{
		temp=a[i];
		a[i]=a[j];
		a[j]=temp;
		replace(i+1,j-1);
	}
	else return;
}
void main()
{
	gets(a);
	replace(0,strlen(a)-1);
	puts(a);
}
main()
{
     int a;
     cin>>a;
     int b;int c;int d;int e;int f;int k=0;
	 if(10000<=a)
     {b=a/10000;
     c=(a-10000*b)/1000;
     d=(a-10000*b-1000*c)/100;
     e=(a-10000*b-1000*c-100*d)/10;
     f=a-10000*b-1000*c-100*d-10*e;
     k=10000*f+1000*e+100*d+10*c+b;
     cout<<k;}
	 else if(1000<=a)
	 {c=(a)/1000;
     d=(a-1000*c)/100;
     e=(a-1000*c-100*d)/10;
     f=a-1000*c-100*d-10*e;
     k=1000*f+100*e+10*d+c;
	 cout<<k;
	 }
	 else if(100<=a)
	 {
       d=(a)/100;
     e=(a-100*d)/10;
     f=a-100*d-10*e;
     k=100*f+10*e+d;
	 cout<<k;
	 }
	 else if(10<=a)
	 {
		  e=(a)/10;
     f=10*e;
     k=10*f+e;
	 cout<<k;
	 }
	 else cout<<k;
}
void main()
{
	char s1[5],s2[5];
	int i,t;
	scanf("%s",s1);
	t=strlen(s1);
	for(i=0;i<t;i++)
	{
		s2[i]=s1[t-i-1];
	printf("%c",s2[i]);
	}
}
int main()
{
	int n,a[5],i,j,sum=0,b;
	scanf("%d",&n);
	a[0]=n/10000;
	a[1]=n/1000-10*a[0];
	a[2]=n/100-10*a[1]-100*a[0];
	a[3]=n/10-10*a[2]-100*a[1]-1000*a[0];
	a[4]=n-10*a[3]-100*a[2]-1000*a[1]-10000*a[0];
	for(i=0;i<=4;i++)
	{
		if(a[i]!=0)
		{
			j=i;
			break;
		}
	}
	for(i=4;i>=j;i--)
	{
		b=(int)pow(10,(i-j));
		sum+=a[i]*b;
	}
	printf("%d",sum);
	return 0;
}
int main()
{
int i;
char a[]={'\0','\0','\0','\0','\0','\0'};
scanf("%s",a);
for(i=0;i<6;i++)
if(a[5-i])
printf("%c",a[5-i]);
return 0;
}
void main()
{
	char *str;
	str=(char*)malloc(5*sizeof(char));
	char*p;
	p=str;
	gets(str);
	for(p=str+strlen(str)-1;p>=str;p--)
		printf("%c",*p);

}
int main(int argc, char* argv[])
{
	int n,i,j,m,t=0,x=0;
	int s[7];
	scanf("%d",&n);
	m=n;

	while(m>0)
	{
	    m=m/10;
	    t++;
	}

	for(i=t;i>=1;i--)
	{
		s[i]=(int)n/pow(10,i-1);
		n=n-(int)s[i]*pow(10,i-1);
	}




	for(i=1;i<=t;i++)
	{
		x=x+s[i]*pow(10,t-i);
	}

printf("%d\n",x);

	return 0;
}
int main()
{
    int i,a[6],k,j;
	scanf("%d",&i);
	for (k=1;k<=10;k++)
	{
		a[k]=(int)((int)(i/pow(10,k-1))-(int)(i/pow(10,k))*10);
		if (a[k]==0) break;
	}

	for (j=1;j<k;j++)
		printf("%d",a[j]);

	return 0;
}
void main()
{
	char a[5];
	char t;
	int n,i;
	gets(a);
	for(n=0;a[n]!='\0';n=n+1);
	for(i=0;i<n/2;i=i+1)
	{
		t=a[i];
		a[i]=a[n-i-1];
		a[n-i-1]=t;
	}
	for(i=0;i<n;i=i+1)
	{
		printf("%c",a[i]);
	}
}
int main()                                         //???
{
	int n,a[5];
	cin>>n;                                        //???????
	for (int j=0;j<5;j++)
        {
           a[j]=n%10;
           n=n/10;
         }
	for (int i=0;i<5;i++)
	{
           if(a[i]>0)
		cout<<a[i];
	}                                            //??????????0???????
	
	return 0;
}
int main()
{
	int n,a,b,c,d,e,k;
	scanf("%d",&n);
	e=n%10;
	d=((n-e)%100)/10;
	c=((n-e-10*d)%1000)/100;
	b=((n-e-10*d-100*c)%10000)/1000;
    a=(n-e-10*d-100*c-1000*b)/10000;
	if(a==0&&b==0&&c==0&&d!=0&&e!=0)
	{
		k=10*e+d;
		printf("%d",k);
	}
	if(a==0&&b==0&&c!=0&&d!=0&&e!=0)
	{
		k=100*e+10*d+c;
		printf("%d",k);
	}
	if(a==0&&b!=0&&c!=0&&d!=0&&e!=0)
	{
		k=1000*e+100*d+10*c+b;
		printf("%d",k);
	}
	if(a!=0&&b!=0&&c!=0&&d!=0&&e!=0)
	{
		k=10000*e+1000*d+100*c+10*b+a;
		printf("%d",k);
	}
	return 0;
}
void main()
{
 char a,b,c,d,e,x,y;
 scanf("%c%c%c%c%c",&a,&b,&c,&d,&e);
 if(c=='\n')
  {x=a;
   a=b;
   b=x;
   printf("%c%c",a,b);}
 else if(d=='\n')
   {x=a;
    a=c;
    c=x;
    printf("%c%c%c",a,b,c); }
else if(e=='\n')
   {x=a;
    a=d;
    d=a;
    y=b;
    b=c;
    c=y;
    printf("%c%c%c%c",a,b,c,d);}
else {x=a;
      a=e;
      e=x;
      y=b;
      b=d;
      d=y;
     printf("%c%c%c%c%c",a,b,c,d,e);}
}
int main()
{
	int n,a,b,c,d,e,result;           //???????n?????????a,b,c,d,e?????result???
	cin>>n;                           //??n
	e=n%10;
	d=(n%100-e)/10;
	c=(n%1000-d*10-e)/100;
	b=(n%10000-c*100-d*10-e)/1000;
	a=(n-n%10000)/10000;              //????n?????????
	if(n>10000)  result=e*10000+d*1000+c*100+b*10+a;
	else if(n>1000) result=e*1000+d*100+c*10+b;
	else if(n>100) result=e*100+d*10+c;
	else if(n>10) result=e*10+d;
	else result=e;                   //????n???????????
	cout<<result<<endl;              //??????
	return 0;
}
int main()
{
    int a, n1, n2, n3, n4, n5, b;
    scanf("%d", &a);
    n1 = a/10000;
    n2 = a/1000 - n1 * 10;
    n3 = a/100 - n1 * 100 - n2 * 10;
    n4 = a/10 - n1 * 1000 - n2 * 100 - n3 * 10;
    n5 = a - n1 * 10000 - n2 * 1000 - n3 * 100 - n4 * 10;
    b = n5 * 10000 + n4 * 1000 + n3 * 100 + n2 * 10 + n1;
    if(a/10==0)
         printf("%d", b/10000);
    else if(a/100==0)
         printf("%d", b/1000);
    else if(a/1000==0)
         printf("%d", b/100);
    else if(a/10000==0)
         printf("%d", b/10);
    else
         printf("%d", b);
    return 0;
}
int main(){
	int n;
	scanf("%d", &n);
	if(n<=10)
		printf("%d", n);
	else{
		if(n<=100){
			int a,b,c;
			a = n/10;
			b = n%10;
			c = b*10 + a;
			printf("%d", c);
		}
		else{
			if(n<=1000){
				int d,e,f,g;
				d = n/100;
				e = (n-d*100)/10;
				f = (n-d*100)%10;
				g = f*100+e*10+d;
		   		printf("%d", g);
			}
			else{
				if(n<=10000){
					int h,i,j,k,l;
					h = n/1000;
					i = (n - h*1000)/100;
					j = (n - h*1000 - i*100)/10;
					k = (n - h*1000 - i*100)%10;
					l = k*1000 + j*100 + i*10 +h;
					printf("%d", l);
				}
				else{
					if(n<=100000){
						int m, o,p,q,r,s;
						m = n/10000;
						o = (n-m*10000)/1000;
						p = (n-m*10000-o*1000)/100;
						q = (n-m*10000-o*1000-p*100)/10;
						r = (n-m*10000-o*1000-p*100)%10;
						s = r*10000+q*1000+p*100+o*10+m;
						printf("%d", s);
					}
				}
			}
		}
	}
	return 0;
}
void main()
{
	int n,a[5],p,i;
	scanf("%d",&n);
	for(i=0;i<5;i++)
	{
	a[0]=n%10;p=a[0];
	if(n%100!=n) {a[1]=(n%100-a[0])/10;p=10*p+a[1];}
	else {p=10*p+(n%100-a[0])/10+100*(n-n%100);break;}
	if(n%1000!=n) {a[2]=(n%1000-10*a[1]-a[0])/100;p=10*p+a[2];}
	else {p=10*p+(n%1000-10*a[1]-a[0])/100+1000*(n-n%1000);break;}
	if(n%10000!=n) {a[3]=(n%10000-100*a[2]-10*a[1]-a[0])/1000;p=10*p+a[3];}
	else {p=10*p+(n%10000-100*a[2]-10*a[1]-a[0])/1000+10000*(n-n%10000);break;}
	if(n%100000!=n) {a[4]=(n%100000-1000*a[3]-100*a[2]-10*a[1]-a[0])/10000;p=10*p+a[4];}
	else {p=10*p+(n%100000-1000*a[3]-100*a[2]-10*a[1]-a[0])/10000+100000*(n-n%100000);break;}
	}
	printf("%d\n",p);
}
void main()
{ int a,b,c,d,e,g;
  scanf("\n%d",&g);
  e=g/10000;
  d=g/1000-10*e;
  c=g/100-10*(g/1000);
  b=g/10-10*(g/100);
  a=g-10*(g/10);
  if(g>=10000) printf("%d%d%d%d%d",a,b,c,d,e);
  else if(g<10000&&g>=1000) printf("%d%d%d%d",a,b,c,d);
  else if(g<1000&&g>=100) printf("%d%d%d",a,b,c);
  else if(g<100&&g>=10) printf("%d%d",a,b);
  else printf("%d",a);
 
}
int main(){
   int n,sum,a,i,b,c,d,e;
   scanf("%d",&n);
   e=n/10000;
   d=n/1000-e*10;
   c=n/100-e*100-d*10;
   b=n/10-e*1000-d*100-c*10;
   a=n%10;
   sum=a*10000+b*1000+c*100+d*10+e;
   for(i=0;i<5;i++){
	   if(sum%10==0){
		   sum=sum/10;
	   }else
		   break;
   }
   printf("%d",sum);
   return 0;
}
void main()
{
	int a,s;
	int b,c;
	int q,w,e,r,t;
	scanf("%d",&a);
	b=1;
	c=0;
    while(a/b>0)
	{b=b*10;
	c=c+1;
	}
	if(c==5)
	{
		q=a/10000;
		w=(a-q*10000)/1000;
		e=(a-q*10000-w*1000)/100;
		r=(a-q*10000-w*1000-e*100)/10;
		t=(a-q*10000-w*1000-e*100-r*10);
		s=t*10000+r*1000+e*100+w*10+q;
	}
	if(c==4)
	{
		q=a/1000;
		w=(a-q*1000)/100;
		e=(a-q*1000-w*100)/10;
		r=(a-q*1000-w*100-e*10);
		s=r*1000+e*100+w*10+q;
	}
    if(c==3)
	{
		q=a/100;
		w=(a-q*100)/10;
		e=(a-q*100-w*10);
	    s=e*100+w*10+q;
	}
    if(c==2)
	{
		q=a/10;
		w=a-q*10;
		s=w*10+q;
	}
	if(c==1)s=a;
	printf("%d\n",s);
}
int main ( )
{ 
	int x,y,a1,a2,a3,a4,a5,i=1;
	for(;i<=4;i=i+1)
	{
    scanf("%d\n",&x);
	a1=x/10000;
	a2=(x-a1*10000)/1000;
	a3=(x-a1*10000-a2*1000)/100;
	a4=(x-a1*10000-a2*1000-a3*100)/10;
	a5=(x-a1*10000-a2*1000-a3*100-a4*10);
	if (a1!=0)
	   y=a5*10000+a4*1000+a3*100+a2*10+a1;
	else
		if (a2!=0)
			y=a5*1000+a4*100+a3*10+a2;
		else
			if (a3!=0)
				y=a5*100+a4*10+a3;
			else 
				if (a4!=0)
					y=a5*10+a4;
				else
					y=a5;
	printf("%d\n",y);
	}
         return 0;
}
void main()
{
char a[6];
int i,n;
for(i=0;i<6;i++)
{
scanf("%c",&a[i]);
if (a[i]=='\n')
{
i--;
n=i;
break;
}
}
for(i=n;i>=0;i--)
printf("%c",a[i]);
printf("\n");
}
void main()
{
	int i;
	char a[6]={0};
	scanf("%s",a);
	for(i=0;i<6;i++)
		if(a[5-i])
			printf("%c",a[5-i]);
}
/*????????????9???????10??????????????1321/10=132???1??????????????132????????????????????????????????????????????????????????9????????????*/
int main ()
{
	int num;
	scanf("%d",&num);//??num
	for(num=num;num>9;num/=10){
/*?????9?????123????????????123???????????3???num=12??????????12??10???2?num=1???9??????????//???,???????*/
		printf("%d",num%10);
	}
	printf("%d",num);
	return 0;
	  }
int main()
{
	char a[6],b[6];
	int d,i;
	scanf("%s",a);
	d=strlen(a);
	for(i=0;i<d;i++)
	{
		a[i];
		b[d-i-1]=a[i];
	}
	b[d]='\0';
		printf("%s",b);
	return 0;
}
void main()
{
	int a,b,c,d,e,B,C,D,E;
	scanf("%d",&a);
	b=a%10000;B=a/10000;
	c=b%1000;C=b/1000;
	d=c%100;D=c/100;
	e=d%10;E=d/10;
	if ((a>=10000)&&(a<=99999))
		printf("%d\n",10000*e+1000*E+100*D+10*C+B);
	else if ((a>=1000)&&(a<=9999)) printf("%d\n",1000*e+100*E+10*D+C);
		else if ((a>=100)&&(a<=999)) printf("%d\n",100*e+10*E+D);
		else if ((a>=10)&&(a<=99)) printf("%d\n",10*e+E);
		else printf("%d\n",e);
}
int main()
{
	int a,b,c,d,e;
	int num;
	scanf("%d",&num);
	a=num/10000;
	b=(int)(num-a*10000)/1000;
	c=(int)(num-a*10000-b*1000)/100;
	d=(int)(num-a*10000-b*1000-c*100)/10;
	e=(int)(num-a*10000-b*1000-c*100-d*10);
	if(num>9999)
	{printf("%d%d%d%d%d\n",e,d,c,b,a);}
	else if(num>999)
	{printf("%d%d%d%d\n",e,d,c,b);}
	else if(num>99)
	{printf("%d%d%d\n",e,d,c);}
	else if(num>9)
	{printf("%d%d\n",e,d);}
	else 
	{printf("%d\n",e);}
	return 0;

}
void main ()
{
	
	char num[5];
	int i,flag=0,j;
	for (i=0;flag==0;i++)
	{
		scanf("%c",&num[i]);
		if (num[i]>'0'&& num[i]<='9')
			flag=0;
		else
			flag=1;
	}
	for (j=i-2;j>=0;j--)
		printf("%c",num[j]);


}
int main(int argc, char* argv[]){
int i;
char n[5]={0};
scanf("%s",n);
for(i=4;i>=0;i--)
{
if(n[i]!='0'&&n[i]!='\0')
printf("%c",n[i]);
}
return 0;
}
int main()
{
int a , b , c , e , f , g , h ;

scanf("%d" , &a) ;
b = a/10000 ;
c = a/1000 - 10 * b ;
e = a/100 - 100*b - 10*c ;
f = a/10 - 1000*b - 100*c - 10*e ;
g = a - 10000*b - 1000*c - 100*e - 10*f ;

if(b != 0 ){
   h = 10000*g + 1000*f + 100*e + 10*c + b ;
   printf("%d" , h) ;
           }

else { 
    if( c != 0){
       h = 1000*g + 100*f + 10*e + c ;
       printf("%d" , h) ;
               }
    else{
         if(e != 0){
         h = 100*g + 10*f + e ;
         printf("%d" , h) ;
                   }
         else{
               if(f != 0){
                 h = 10*g + f ;
                 printf("%d" , h) ;
                         }
               else
               printf("%d" , g) ;
               }
         }
      }
return 0 ; 
}
void main()
{
 int i=0;
 char str[10];
 scanf("%s",str);
 while(str[i]!='\0')
  i++;
 for(i--;i>=0;i--)
 printf("%c",str[i]);
 printf("\n");
}
void main()
{
int a[5];
int i,j,m,n;
scanf("%d",&n);
for(i=5;i>0;)
{
	j=(int)pow(10,i-1);
	if(n/j!=0)break;
	i--;
}
for(j=0;j<i;j++)
{m=(int)pow(10,i-1-j);
 a[j]=(int)(n/m)-10*((int)(n/(10*m)));
}
for(j=0;j<i;j++)
 printf("%d",a[i-1-j]);
}
void main()
{
	char a[10]={0};
    int n,i;
	
	gets(a);
	
	n=0;

	for(i=0;a[i]!='\0';i=i+1)
		n=n+1;

	for(i=n-1;i>=0;i=i-1)
		printf("%c",a[i]);
}
void main()
{
int n,i,a,b,c,d,e,s,f,g,h;
scanf("%d",&n);
a=n/10000;
b=(n-10000*a)/1000;
c=(n-10000*a-1000*b)/100;
d=(n-10000*a-1000*b-100*c)/10;
e=n-10000*a-1000*b-100*c-10*d;
f=n/1000;
g=n/100;
h=n/10;
if(h==0)
s=n;
else if(g==0)
s=10*e+d;
else if(f==0)
s=100*e+10*d+c;
else if(a==0)
s=1000*e+100*d+10*c+b;
else
s=10000*e+1000*d+100*c+10*b+a;

printf("%d",s);
}
int main(int argc, char* argv[])
{
	int i;
	scanf("%d",&i);
	if(i<10)
		printf("%d\n",i);
	if(i>10&&i<100)
	{
		i=i%10*10+i/10;
		printf("%d\n",i);
	}
	if(i>100&&i<1000)
	{
		i=i%10*100+i%100/10*10+i/100;
		printf("%d\n",i);
	}
	if(i>1000&&i<10000)
	{
		i=i%10*1000+i%1000%100/10*100+i%1000/100*10+i/1000;
		printf("%d\n",i);
	}
	if(i>10000&&i<99999)
	{
		i=i%10*10000+i%10000%1000%100/10*1000+i%10000%1000/100*100+i%10000/1000*10+i/10000;
		printf("%d\n",i);
	}
	return 0;
}
int main(){
	int n;
	scanf("%d",&n);
	int i,l,h,m=n;
	for(i=0;l!=0;i++){
		l=m/10;
		m=l;
	}
	int g;
	for(g=0;g<i;g++){
		h=n%10;
		printf("%d",h);
		n=n/10;
	}
	return 0;
}
int main()
{
	int a[5]={11,11,11,11,11};
	int i=0,b,j;
	scanf("%d",&b);
	while(b>0)
	{
		a[i]=b%10;
		i++;
		b=b/10;
	}
	for (j=0;j<5;j++)
	{
		if (a[j]<10)
			printf("%d",a[j]);
	}
	printf("\n");
	return 0;
}
//???????
//??????????
//???1000012750?
int main()                                  //?????
{                                           //?????
    int s,a,b,c,d,e;                        //????
	cin>>s;                                 //????
	a=s/10000;                              //??????
	b=(s-a*10000)/1000;                     //??????
	c=(s-a*10000-b*1000)/100;               //??????    
	d=(s-a*10000-b*1000-c*100)/10;          //??????  
	e=s%10;                                 //??????
	if(a!=0)                                //????????????????
	    s=e*10000+d*1000+c*100+b*10+a;
    else if(b!=0)
		s=e*1000+d*100+c*10+b;
	else if(c!=0)
		s=e*100+d*10+c;
	else if(d!=0)
		s=e*10+d;
	else 
		s=e;                                
	cout<<s;                                //????
	return 0;                               //???????????????????
}                                           //?????
void main()
{
	int a,b,a1,a2,a3,a4,a5;
	scanf("%d",&a);
	a1=a/10000;
	a2=(a-a1*10000)/1000;
	a3=(a-a1*10000-a2*1000)/100;
	a4=(a-a1*10000-a2*1000-a3*100)/10;
	a5=a-a1*10000-a2*1000-a3*100-a4*10;
	if(a1==0&&a2==0&&a3==0&&a4==0&&a5>0)
	b=a5;
	else if(a1==0&&a2==0&&a3==0&&a4>0&&a5>0)
	b=a5*10+a4;
	else if(a1==0&&a2==0&&a3>0&&a4>0&&a5>0)
	b=a5*100+a4*10+a3;
	else if(a1==0&&a2>0&&a3>0&&a4>0&&a5>0)
	b=a5*1000+a4*100+a3*10+a2;
	else {b=a5*10000+a4*1000+a3*100+a2*10+a1;}
	printf("%d",b);
}
void main()
{
	int n,a,b,c,d,e;
	scanf("%d",&n);
	a=n/10000;
	b=(n-a*10000)/1000;
	c=(n-a*10000-b*1000)/100;
	d=(n-a*10000-b*1000-c*100)/10;
	e=(n-a*10000-b*1000-c*100-d*10)/1;
	if(a!=0)
		printf("%d%d%d%d%d\n",e,d,c,b,a);
	else if(b==0)
			printf("%d%d%d\n",e,d,c);
	else
		printf("%d%d%d%d\n",e,d,c,b);
}
void main()
{   
	int a,t1,t2,t3,t4,t5,w;
	scanf("%d",&a);
	if(a/10000>0)w=5;
	else if(a/1000>0)w=4;
	else if(a/100>0)w=3;
	else if(a/10>0)w=2;
	else w=1;
	t1=a/10000;
    t2=a/1000-t1*10;
    t3=a/100-t1*100-t2*10;
    t4=a/10-t1*1000-t2*100-t3*10;
	t5=a/1-t1*10000-t2*1000-t3*100-t4*10;

	switch(w)
	{
	case 5:printf("%d%d%d%d%d\n",t5,t4,t3,t2,t1);break;
	case 4:printf("%d%d%d%d\n",t5,t4,t3,t2);break;
	case 3:printf("%d%d%d\n",t5,t4,t3);break;
	case 2:printf("%d%d\n",t5,t4);break;
	case 1:printf("%d\n",t5);break;
    }
}
int main(int argc, char * argv[]) 
{ 
    int m,a,b,c,d,e,p,x,y;
    scanf("%d",&m);
    a=m/10000;
    b=m%10000/1000;
    c=m%1000/100;
    d=m%100/10;
    e=m%10;
    p=e*10000+d*1000+c*100+b*10+a;
    x=(10-a)/10;
    y=1-x;
    p=p/10*x+p*y;
    x=(10-b)/10;
    y=1-x;
    p=p/10*x+p*y;
    x=(10-c)/10;
    y=1-x;
    p=p/10*x+p*y;
    x=(10-d)/10;
    y=1-x;
    p=p/10*x+p*y;
    printf("%d",p);
}
void main()
{
	long x;
	int p,a,b,c,d,e;
	scanf("%ld",&x);
	if(x>9999)
		p=5;
	else if(x>999)
		p=4;
	else if(x>99)
		p=3;
	else if(x>9)
		p=2;
	else p=1;
	switch(p)
	{
	case 1:printf("%d\n",x);break;
	case 2:b=x/10;
		a=x-b*10;
		printf("%d%d\n",a,b);break;
	case 3:c=x/100;
		b=(x-c*100)/10;
		a=x-c*100-b*10;
		printf("%d%d%d\n",a,b,c);break;
	case 4:d=x/1000;
		c=(x-d*1000)/100;
		b=(x-d*1000-c*100)/10;
		a=x-d*1000-c*100-b*10;
		printf("%d%d%d%d\n",a,b,c,d);break;
	case 5:e=x/10000;
		d=(x-e*10000)/1000;
		c=(x-e*10000-d*1000)/100;
		b=(x-e*10000-d*1000-c*100)/10;
		a=x-e*10000-d*1000-c*100-b*10;
		printf("%d%d%d%d%d\n",a,b,c,d,e);break;
	}
}
int main(int argc, char* argv[])
{
	int n,a[6],i,p;
	scanf ("%d",&n);
	for (i=1;i<=6;i++)
	{
		a[i]=n%10;
		n=n/10;
	    if (a[i]==0)
		{
			p=i;
		break;
		}
	}
    for (i=1;i<p;i++)
	{
		printf ("%d",a[i]);
	}
	return 0;
}
void main()
{
	int a,b,c,d,e,f,g;
		scanf("%d",&a);
	b=a/10000;
	c=a/1000-b*10;
	d=a/100-b*100-c*10;
	e=a/10-b*1000-c*100-d*10;
	f=a-b*10000-c*1000-d*100-e*10;
	if(b!=0)
		printf("%d%d%d%d%d",f,e,d,c,b);
	else if(c!=0)
		printf("%d%d%d%d",f,e,d,c);
	else if(d!=0)
	{
		g=100*f+10*e+d;
		printf("%d",g);
	}
	else if(e!=0)
		printf("%d%d",f,e);
	else if(f!=0)
		printf("%d",f);
}
int main(int argc, char* argv[])
{
    int a,b,c,n;
	scanf("%d",&n);
	a=n/100;
	b=(n-100*a)/10;
	c=n-100*a-10*b;
	int m;
	m=100*c+10*b+a;
	printf("%d\n",m);
	return 0;
}
int main() {
	int n;
	scanf ("%d", &n);
    int i,j;
	int q;
    int s[5];
	for (i=0; i<5; i++) {
		q=n%10;
		n=n/10;
		s[i]=q;
	}
	for (j=0; j<5; j++) {
		if (s[j] != 0) {
	        printf ("%d", s[j]);
		}
	}
	return 0;
}
void main()
{
int n,t,i,z=1,a[5],m=0;
scanf("%d",&n);
t=n;
while(t/10!=0)
{z++;t=t/10;
}
for(i=0;i<z;i++)
{
a[i]=n%10;
m=m*10+a[i];
n=n/10;
}
printf("%d",m);
}
int main()
{
    long int a;
    int x[5],i,j=0,n,m,y;
    scanf("%ld",&a);
    while(a>0)
         {x[j]=a%10;
          j++;
          a=a/10;
         }
    for(i=0;i<j;i++)
    printf("%d",x[i]);
}
main()
{
      int sum;
      int i, n, a[6];
      
      scanf("%d", &sum);
      
      n = (int)(log(sum) / log(10)) + 1;
      for(i = 1;i <= n; i++)
      {
            a[i] = (sum / (int)pow(10, i - 1)) % 10;
            
      }
      
      for(i = n;i >= 1;i --)
      {
            printf("%d", a[n + 1 - i]);
            }
}
void main()
{
	int a,i,n;
	scanf("%d",&a);
	i=1;
	while(i!=0)
	{
		n=a%10;
		i=a/10;
		a=i;
		printf("%d",n);
	}
}
int main(int argc, char* argv[])
{
	int a,b,c,d,e,n,f;
	scanf("%d",&n);
	a=n/10000;
	b=n/1000-(10*a);
	c=n/100-100*a-10*b;
	d=n/10-a*1000-b*100-c*10;
	e=n-10000*a-1000*b-100*c-10*d;
	if(n>100&&n<1000)
	{
		f=100*e+10*d+c;
		printf("%d\n",f);
	}
       else if(n>1000&&n<10000)
	{
		f=1000*e+100*d+10*c+b;
		printf("%d\n",f);
	}
	   else
	   {
        f=10000*e+1000*d+100*c+10*b+a;
		printf("%d\n",f);
	   }

	return 0;
}
int main()
{
	int a;
	scanf("%d",&a);
	if(a<10)
		printf("%d",a);
	if((a>10)&&(a<100)){
		int shiwei=0;
		shiwei=a/10;
		int gewei=0;
		gewei=a-10*shiwei;
		printf("%d%d",gewei,shiwei);
	}
	if((a>100)&&(a<1000)){
		int ge=0,shi=0,bai=0;
		bai=a/100;
		shi=(a-bai*100)/10;
		ge=a-bai*100-shi*10;
		printf("%d%d%d",ge,shi,bai);
	}
	if((a>1000)&&(a<10000)){
		int ge=0,shi=0,bai=0,qian=0;
		qian=a/1000;
		bai=(a-qian*1000)/100;
		shi=(a-qian*1000-bai*100)/10;
		ge=a-qian*1000-bai*100-shi*10;
		printf("%d%d%d%d",ge,shi,bai,qian);
	}
	if((a>10000)&&(a<100000)){
		int ge=0,shi=0,bai=0,qian=0,wan=0;
        wan=a/10000;
		qian=(a-wan*10000)/1000;
        bai=(a-wan*10000-qian*1000)/100;
		shi=(a-wan*10000-qian*1000-bai*100)/10;
		ge=a-wan*10000-qian*1000-bai*100-shi*10;
		printf("%d%d%d%d%d",ge,shi,bai,qian,wan);
	}

    return 0;
}
int main()
{
	int x;
	scanf("%d",&x);
	if(x<10)
		printf("%d",x);
	else if(9<x&&x<100)
		printf("%d",x%10*10+x/10);
    else if(99<x&&x<1000)
		printf("%d",x%10*100+x%100/10*10+x/100);
	else if(999<x&&x<10000)
		printf("%d",x%10*1000+x%100/10*100+x%1000/100*10+x/1000);
	else if(9999<x&&x<100000)
		printf("%d",x%10*10000+x%100/10*1000+x%1000/100*100+x%10000/1000*10+x/10000);
}
void main()
{
	char c;
	int y;
	y=0;
	int t;
	t=1;
	c=getchar();
	while (c!=10)
	{
		y=y+(c-48)*t;
		t=t*10;
		c=getchar();
	}
	printf("%d",y);
}
int main()
{
    void a(int x,int y);
    int n;
    scanf("%d",&n);
    a(n,10000);
        return 0;
}


void a(int x,int y)
{
     int t,k,p;
     
     t=x/y;
     x=x-t*y;
     if(y==1)printf("%d",t);
     else
     {
         a(x,y/10);
         if(t==0);
         else printf("%d",t);
     }
    
}
int main()
{int a,b,i,y,x;
 char c,am[10]={0},bm[10]={0};
 for(i=0;;i++)
 {c=getchar();if(c=='\n')break;
 if(c!='\n')am[i]=c;}
 for(x=0;x<i;x++)
 {bm[x]=am[i-1-x];}
 for(x=0;x<i;x++)printf("%c",bm[x]);
 
 
 


return 0;


}
int main()
{
	int a;
	int b,c,d;
	int e,f,g;
	int h,i,j,k;
	int l,m,n,o,p;
	scanf("%d",&a);
	if (a<10&&a>0)
	{
		b=a;
		printf("%d",a);
	}
	if (a<100&&a>9)
	{
		c=a/10;
		d=a-10*c;
		printf("%d%d",d,c);
	}
	if (a<1000&&a>99)
	{
		e=a/100;
		f=(a-100*e)/10;
		g=a-e*100-f*10;
		printf("%d%d%d",g,f,e);
	}
	if (a<10000&&a>999)
	{
		h=a/1000;
		i=(a-1000*h)/100;
		j=(a-h*1000-i*100)/10;
		k=a-h*1000-i*100-j*10;
		printf("%d%d%d%d",k,j,i,h);
	}

	if (a<100000&&a>9999)
	{
		l=a/10000;
		m=(a-10000*l)/1000;
		n=(a-l*10000-m*1000)/100;
		o=(a-l*10000-m*1000-n*100)/10;
		p=a-l*10000-m*1000-n*100-o*10;
		printf("%d%d%d%d%d",p,o,n,m,l);
	}

	
	return 0;
}
void main()
{
	int m,n=0,i,a[6]={0};
	scanf("%d",&m);
		if(m<10)
		{ n=m;
        printf("%d\n",n);}
		else 
		{
			for(i=1;i<=5;i++)
			{
			a[i]=m%10;
			m=(m-a[i])/10;
			}
	if(a[5]!=0)
		n=a[5]+a[4]*10+a[3]*100+a[2]*1000+a[1]*10000;
	else if(a[4]!=0)
		n=a[4]+a[3]*10+a[2]*100+a[1]*1000;
	else if(a[3]!=0)
		n=a[3]+a[2]*10+a[1]*100;
	else if(a[2]!=0)
		n=a[2]+a[1]*10;
	else
		n=a[1];
       printf("%d\n",n);}
}
main()
{
	int a[5],m,n;
	long f;
	scanf("%ld",&f);
	if (f>9999) n=5;
	else if (f>999) n=4;
	else if (f>99) n=3;
	else if (f>9) n=2;
	else n=1;
	m=n;
	while(n>0)
	{
		a[n]=f%10;
		f=f/10;
		n=n-1;
	}
	n=m;
	while(n>0)
	{
		printf("%d",a[n]);
		n=n-1;
	}
	printf("\n");
}
void main()
{
	int m,a,b,c,d,e,k;
	scanf("%d",&m);
	a=m/10000;
	b=(m-10000*a)/1000;
	c=(m-10000*a-1000*b)/100;
	d=(m-10000*a-1000*b-100*c)/10;
	e=m%10;
	if(a!=0)
		k=10000*e+1000*d+100*c+10*b+a;
	else
		if(a==0&&b!=0)
			k=1000*e+100*d+10*c+b;
		else
			if(a==0&&b==0&&c!=0)
				k=100*e+10*d+c;
			else
				if(a==0&&b==0&&c==0&&d!=0)
					k=10*e+d;
				else
					k=e;
				printf("%d\n",k);
}
int m=0,k=0,j=0;
void main()
{
	int n;
	int v(int a);
	scanf("%d",&n);
	printf("%d",v(n));
}
  int v(int a)
  {
 
  	if(a!=0)
  	{
  	m=a%10;
  	k=a/10;
  	j=j*10+m;
  	
  	v(k);
  	}
  	
  	return(j);
  }
int main()
{
	int *x, y;
	int i;
	x=malloc(4*sizeof(int));
	for(i=0; i<4; i++)
	{
		scanf("%d", x+i);
	}
	for(i=0; i<4; i++)
	{
		y=*(x+i);
		while(y!=0)
	{
		printf("%d", y % 10);
		y = y / 10;
	}
		printf("\n");
	}
	
	return 0;
}
int main()
{
	int a,i,b,c,d,e,n,f;
	scanf("%d",&n);
	a=n/10000;
	b=(n-10000*a)/1000;
	c=(n-10000*a-1000*b)/100;
	e=n%10;
	d=(n%100-e)/10;
	f=e*10000+d*1000+100*c+10*b+a;
	for(i=0;i<=4;i++){
		if(f%10==0)
			f=f/10;
		}
	    printf("%d",f);
	
	return 0;
}
void main()
{
	int t,a[4],i;
	scanf("%d",&t);
	a[0]=t/10000;
	a[1]=(t-a[0]*10000)/1000;
	a[2]=(t-a[0]*10000-a[1]*1000)/100;
    a[3]=(t-a[0]*10000-a[1]*1000-a[2]*100)/10;
	a[4]=t-a[0]*10000-a[1]*1000-a[2]*100-a[3]*10;
	for(i=4;a[i]!=0&&i>=0;i--)
	printf("%d",a[i]);
}
void main()
{
	int a,b,c,d,e;
	unsigned int num;
	scanf("%u",&num);
    if(num>10000)
	{
		a=num/10000;
		b=(num-a*10000)/1000;
		c=(num-a*10000-b*1000)/100;
		d=(num-a*10000-b*1000-c*100)/10;
		e=num-a*10000-b*1000-c*100-d*10;
		printf("%d%d%d%d%d\n",e,d,c,b,a);
	}
	else if((num<10000)&&(num>1000))
	{
		b=num/1000;
		c=(num-b*1000)/100;
		d=(num-b*1000-c*100)/10;
		e=num-b*1000-c*100-d*10;
		printf("%d%d%d%d\n",e,d,c,b);
	}
	else if((num<1000)&&(num>100))
	{
		c=num/100;
		d=(num-c*100)/10;
		e=num-c*100-d*10;
		printf("%d%d%d\n",e,d,c);
	}
	else if((num<100)&&(num>10))
	{
		d=num/10;
		e=num-d*10;
		printf("%d%d\n",e,d);
	}
	else if(num<10)
	{
		e=num;
		printf("%d\n",e);
	}	
}