semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int x;
	int a;
	int b;
	int c;
	int d;
	int e;
	scanf("%d",&x);
	a=x/10000;
	b=(x-10000*a)/1000;
	c=(x-10000*a-1000*b)/100;
	d=(x-10000*a-1000*b-100*c)/10;
	e=x%10;
	{
		if(a==0&&b!=0&&c!=0&&d!=0&&e!=0)
			printf("%d%d%d%d",e,d,c,b);
		else
			if(a==0&&b==0&&c!=0&&d!=0&&e!=0)
				printf("%d%d%d",e,d,c);
			else
				if(a==0&&b==0&&c==0&&d!=0&&e!=0)
					printf("%d%d",e,d);
				else
					if(a==0&&b==0&&c==0&&d==0&&e!=0)
						printf("%d",e);
					else
						if(a!=0&&b!=0&&c!=0&&d!=0&&e!=0)
							printf("%d%d%d%d%d",e,d,c,b,a);
						else
							printf("I don't know!");
	}
	return 0;
}
int main()
{
	long a,b,c,d,e,x;
         int i=1;
	loop:if(i<=4)
         {
         scanf("%ld",&x);
	a=x/10000;
	b=(x-a*10000)/1000;
	c=(x-a*10000-b*1000)/100;
	d=(x-a*10000-b*1000-c*100)/10;
	e=x-a*10000-b*1000-c*100-d*10;
	if(a==0&&b==0&&c==0&&d==0)
		printf("%d\n",e);
	else if(a==0&&b==0&&c==0)
		printf("%d%d\n",e,d);
	else if(a==0&&b==0)
	    printf("%d%d%d\n",e,d,c);
	else if(a==0)
		printf("%d%d%d%d\n",e,d,c,b);
	else
               printf("%d%d%d%d%d\n",e,d,c,b,a);
         i++;
         goto loop;
         }
	return 0;
}
int main(int argc, char* argv[])
{
	char num[5],chu[5];
	scanf("%s",&num);
	int a=0,i,j,e=0;
	for(i=0;num[i]!='0'&&num[i]!='\0';i++)
	{
		a++;
	}

	for(j=a-1;j>=0;j--)
	{
		chu[e]=num[j];
		e++;
	}
	printf("%s",chu);
	
	return 0;
}
void main() 
{
	int n,a,b,c,d,e;
	scanf("%d",&n);
	a=n%10;n=n/10;
	b=n%10;n=n/10;
	c=n%10;n=n/10;
	d=n%10;n=n/10;
	e=n%10;n=10000*a+1000*b+100*c+10*d+e;
	if(n%10==0) n=n/10;
	if(n%10==0) n=n/10;
	if(n%10==0) n=n/10;
	if(n%10==0) n=n/10;
	printf("%d\n",n);
}
int main()
{
	int n,a[5],i;
	scanf("%d",&n);
    a[0]=n%10;a[1]=(int)(n%100)/10;
	a[2]=(int)(n%1000)/100;
	a[3]=(int)(n%10000)/1000;
	a[4]=(int)(n%100000)/10000;
	for(i=0;i<5;i++){
		if(a[i]!=0) printf("%d",a[i]);}
	return 0;
}
int main()
{
	int n,a,b,c,d,e,sum,m;
	scanf("%d",&n);
	a=n%10;
	b=(n%100-a)/10;
	c=(n%1000-n%100)/100;
	d=(n%10000-n%1000)/1000;
	e=(n%100000-n%10000)/10000;
	sum=10000*a+1000*b+100*c+10*d+e;
	if(sum%10000==0)
		m=sum/10000;
	else if(sum%1000==0)
		m=sum/1000;
	else if(sum%100==0)
		m=sum/100;
	else if(sum%10==0)
		m=sum/10;
	else
		m=sum;
	printf("%d\n",m);
	return 0;
}
int main()
{
	int a[4],i,x,y;
	for(i=0;i<=3;i++)
	scanf("%d\n",&a[i]);
	for(i=0;i<=3;i++)
	{
	
	
	x=a[i];

	if(x<=9)
		y=x;
	else
	{
		y=0;
		for(;x>9;x/=10)
			y=(y+x-x/10*10)*10;
			y=y+x;

	}
	printf("%d\n",y);
	}
	
	return 0;
}
int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	int x1,x2,x3,x4,x5;
	x1=n%10;
	x2=((n-x1)%100)/10;
	x3=((n-x1-x2*10)%1000)/100;
	x4=((n-x1-x2*10-x3*100)%10000)/1000;
	x5=((n-x1-x2*10-x3*100-x4*1000)%100000)/10000;
    if(x5!=0)
	{
		printf("%d%d%d%d%d",x1,x2,x3,x4,x5);
	}
	else if(x5==0&&x4!=0)
	{
		printf("%d%d%d%d",x1,x2,x3,x4);
	}
	else if(x5==0&&x4==0&&x3!=0)
	{
		printf("%d%d%d",x1,x2,x3);
	}
	else if(x5==0&&x4==0&&x3==0&&x2!=0)
	{
		printf("%d%d",x1,x2);
	}
	return 0;
}
int main(){
    int n,a,b,c,d,e,m;
	scanf("%d",&n);
	a=(int)(n/10000);
	n=n-10000*a;
	b=(int)(n/1000);
	n=n-1000*b;
	c=(int)(n/100);
	n=n-100*c;
	d=(int)(n/10);
	e=n-10*d;
    if(a==0){
		if(b!=0){
		m=e*1000+d*100+c*10+b;}
		else{
			if(c!=0){
			m=e*100+d*10+c;}
			else{
				if(d!=0){
				m=e*10+d;}
				else{
				   m=e;
				}
			}
		}
	}
	else{m=e*10000+d*1000+c*100+b*10+a;}
	printf("%d",m);
	 return 0;
}
int main()
{
int n,sz[5],i,a=0,b,c[5],j;
scanf("%d",&n);
b=n;
for(i=0;b>0;i++){
	b=b/10;
}
a=i;
for(i=0;i<a;i++){
	sz[i]=n;
}
for(i=0;i<a;i++){
	for(j=0;j<a-i-1;j++){
		sz[i]=sz[i]/10;
	}
}
c[0]=sz[0];
for(i=1;i<a;i++){
	c[i]=sz[i]-(sz[i-1]*10);
}
for(i=a-1;i>=0;i--){printf("%d",c[i]);}
return 0;
}
void main()
{
	int a,b,c;
	scanf("%d",&a);
	b=0;
	for(c=a%10;a>0;)
	{
		b=b*10+c;
		a=(a-c)/10;
		c=a%10;
	}
	printf("%d",b);
}
int main(int argc, char* argv[])
{
	int i, len;
	char s[6], t;

	gets(s);
	len = strlen(s);
	
	for (i = 0; i < (len/2); i++)
	{
		t = s[len - (i+1)];
		s[len-(i+1)] = s[i];
		s[i] = t;
	}
	printf("%s", s);
	return 0;
}
int main()
{
    char num[10],temp;
    int i,j;
    scanf("%s", num);
    for(i=0;i<floor(strlen(num)/2);i++)
    {
                                                                  temp=num[i];
                                                                  num[i]=num[strlen(num)-i-1];
                                                                  num[strlen(num)-i-1]=temp;
    }
    for(i=0;i<strlen(num);i++)
    {
                              printf("%c",num[i]);
    }                
    return 0;
}
int main()
{
	int inPut, outPut;
	scanf("%d",&inPut);
	if(inPut<10)
		printf("%d",inPut);
	else if(inPut>=10&&inPut<100){
		outPut=(inPut%10)*10+(inPut/10);
	}
	else if(inPut>=100&&inPut<1000){
		outPut=(inPut%10)*100+((inPut/10)%10)*10+(inPut/100);
	}
	else if(inPut>=1000&&inPut<10000){
		outPut=(inPut%10)*1000+((inPut/10)%10)*100+((inPut/100)%10)*10+inPut/1000;
	}
	else if(inPut>=10000&&inPut<100000){
		outPut=(inPut%10)*10000+((inPut/10)%10)*1000+((inPut/100)%10)*100+((inPut/1000)%10)*10+(inPut/10000);
	}
	printf("%d",outPut);
	return 0;
}
void main()
{
	int a[5],A,b,c,i;
	scanf("%d",&A);
	b=A;
	for(c=0;b>=1;c++)
	{
		b=b/10;
	}
	for(i=0;i<=c-1;i++)
	{
		a[i]=A%10;
		A=A/10;
	}
	for(i=0;i<=c-2;i++)
	{	printf("%d",a[i]);
	}
     printf("%d\n",a[c-1]);
}
int main(int argc, char * argv[]) 
{ 
   int x,a,b,c,d,e,m=0;
   scanf("%d",&x);
   a=x%10;m=10*m+a;
   b=(x/10)%10;m=10*m+b;
   c=(x/100)%10;m=10*m+c;
   d=(x/1000)%10;m=10*m+d;
   e=(x/10000)%10;m=10*m+e;
   if(e==0) m=m/10;
   else m=m;
   if(e==0,d==0) m=m/10;
   else m=m;
   if(e==0,d==0,c==0) m=m/10;
   else m=m;
   if(e==0,d==0,c==0,b==0) m=m/10;
   else m=m;printf("%d",m);
}
void main()
{
     char a,b,c,d,e;
     scanf("%c%c%c%c%c",&a,&b,&c,&d,&e);
     printf("%c%c%c%c%c\n",e,d,c,b,a);
}
void main()
{
   int di,number,k,j,n;
   n=1;
   di=10;
   scanf("%d",&number);
   do
   {
	   j=number-di;
   if(j>0)
   {
   n=n+1;
   di=di*10;
   }
   }
   while(j>0);
   j=0;
   di=10;
   do
   {
	   k=((number%di)-(number%(di/10)))/(di/10);
	   printf("%d",k);
       di=di*10;
	   j=j+1;       
   }
while(j<n);
}
main()
{
	int a,n=0,b,i,c;
	scanf("%d",&a);
	b=a;
	while(a>=1)
	{
		a=a/10;
		n=n+1;
	}
	for(i=0;i<n;i++)
	{
		c=b%10;
		printf("%d",c);
		b=(b-b%10)/10;
	}
}
void main()
{
	int a,b,c,d,e,f,g;
	scanf("%d",&a);
	b=(a%100000)/10000;
	c=(a%10000)/1000;
	d=(a%1000)/100;
	e=(a%100)/10;
	f=a%10;
	g=b*1+c*10+d*100+e*1000+f*10000;
	if(a>9999)
		;
	else
	    if(a>999)
			g=g/10;
    else
		if(a>99)
			g=g/100;
		else
			if(a>9)
				g=g/1000;
			else
				g=g/10000;
	printf("%d",g);
}
int main()
{
	int num;
	
	int i,n[5];
	
	
	scanf("%d",&num);
	if (num>0 && num<10)
	{
	for (i=0;i<1;i++)
	{
		n[i]=num%10;
		num=num/10;
		if (num<1)
			break;
	}
	
	printf("%d\n",n[0]);
	
	return 0;
	}
	if (num>9 && num<100)
	{
	for (i=0;i<2;i++)
	{
		n[i]=num%10;
		num=num/10;
		if (num<1)
			break;
	}
	
	printf("%d%d\n",n[0],n[1]);
	
	return 0;
	}
	if (num>99 && num<1000)
	{
	for (i=0;i<3;i++)
	{
		n[i]=num%10;
		num=num/10;
		if (num<1)
			break;
	}
	
	printf("%d%d%d\n",n[0],n[1],n[2]);
	
	return 0;
	}
	if (num>999 && num<10000)
	{
	for (i=0;i<4;i++)
	{
		n[i]=num%10;
		num=num/10;
		if (num<1)
			break;
	}
	
	printf("%d%d%d%d\n",n[0],n[1],n[2],n[3]);
	
	return 0;
	}
	if (num>9999 && num<100000)
	{
	for (i=0;i<5;i++)
	{
		n[i]=num%10;
		num=num/10;
		
			
	}
	
	printf("%d%d%d%d%d\n",n[0],n[1],n[2],n[3],n[4]);
	
	return 0;
	}
		return 0;
}
int main(int argc, char*argv[])
{
    int x,y,a,b,c,d,e;
    int p,q,r;
    int h,i,j,k;
    scanf("%d",&x);
    a=x/10000;
    p=x%10000;
    b=p/1000;
    q=p%1000;
    c=q/100;
    r=q%100;
    d=r/10;
    e=r%10;
    y=e*10000+d*1000+c*100+b*10+a;
    h=y%10;
    i=y%100;
    j=y%1000;
    k=y%10000;
    if(h==0)
      if(i==0)
        if(j==0)
          if(k==0)
            printf("%d",e);
          else
            printf("%d%d",e,d);
        else
          printf("%d%d%d",e,d,c);
      else
        printf("%d%d%d%d",e,d,c,b);
    else
      printf("%d%d%d%d%d",e,d,c,b,a);
    return 0;
}
int main()                                      //???
{                                               //?????
    int x,y,a,b,c,d,e;                          //??x,y,a,b,c,d,e?????
    cin>>x;                                     //??x
    if (x<10)  cout<<x<<endl;                   //?x????????????          
    else if (x<100)                             //?x???????????? 
	{
		a=x%10;
	    b=(x-a)/10;
		y=a*10+b;
		cout<<y<<endl;
	}
	else if (x<1000)                            //?x???????????? 
	{
		a=x%10;
		b=((x-a)/10)%10;
		c=floor(x/100);
		y=a*100+b*10+c;
		cout<<y<<endl;
	}
	else if (x<10000)                           //?x???????????? 
	{
		a=x%10;
		b=((x-a)/10)%10;
		d=floor(x/1000);
		c=floor(x/100)-10*d;
		y=a*1000+b*100+c*10+d;
        cout<<y<<endl;
	}
	else if (x<100000)                           //?x???????????? 
	{
		a=x%10;
        b=((x-a)/10)%10;
		c=((x-a-10*b)/100)%10;
		e=floor(x/10000);
		d=floor(x/1000)-10*e;
		y=a*10000+b*1000+c*100+d*10+e;
		cout<<y<<endl;
	}
    return 0;
}                                                //?????
int main ()
{
	char ch[5], a;
	int i, n=0;
	for (i=0; (ch[i]=getchar())!='\n'; i++)
			n++;
	for (i=n-1; i>=0; i--)
	printf ("%c", ch[i]);
	return 0;
}
int main()
{
	int m,i;
	char a[6];
	scanf("%s",a);
    m=strlen(a);
	for(i=m;i>=0;i--)
	{
		if(a[i]=='\0') continue;
		else printf("%c",a[i]);
	}
	return 0;
}
void main()
{
 int n,w,q,b,s,g,k,a[200],i;
 scanf ("%d",&n);
 w=n/10000;
 q=(n-w*10000)/1000;
 b=(n-w*10000-q*1000)/100;
 s=(n-w*10000-q*1000-b*100)/10;
 g=n-w*10000-q*1000-b*100-s*10;
 if (w==0&&q!=0&&b!=0&&s!=0) k=4;
 else if (w==0&&q==0&&b!=0&&s!=0) k=3;
 else if (w==0&&q==0&&b==0&&s!=0) k=2;
 else if (w==0&&q==0&&b==0&&s==0) k=1;
 else k=5;
 a[0]=g;a[1]=s;a[2]=b;a[3]=q;a[4]=w;
 for (i=0;i<k;i++)
 { printf ("%d",a[i]);}
}
int main()
{
int a,b=0;
scanf("%d",&a);

 while(a)
 {
  b*=10;
  b+=a%10;
  a/=10;
 }
 printf("\n%d",b);
return 0;
}
int main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
		if(a<10)
			printf("%d",a);
		else
			if(a>=10&&a<100){
                b=a/10+(a-a/10)*10;
			printf("%d",b);
			}
			else
				if(a>=100&&a<1000){
				c=a/100+(a/10-(a/100)*10)*10+(a-(a/10)*10)*100;
			printf("%d",c);
				}
			else
				if(a>=1000&&a<10000){
				d=a/1000+(a/100-(a/1000)*10)*10+(a/10-(a/100)*10)*100+(a-(a/10)*10)*1000;
			printf("%d",d);
				}
            else
			    if(a>=10000){
				e=a/10000+(a/1000-(a/10000)*10)*10+(a/100-(a/1000)*10)*100+(a/10-(a/100)*10)*1000+(a-(a/10)*10)*10000;
            printf("%d",e);
			}
	return 0;
}
main()
{
	char line[6];
	int i,j,k;
	scanf("%s",line);
	for(i=0,k=0;line[i]!='\0';i++)
		k=k+1;
	for(j=k-1;j>=0;j--)
		printf("%c",line[j]);
}
/*??????*/
int main()
{
	char num[6];
	int a;
	cin>>num;
	a=strlen(num);//???????
	int i,j;
	char t;
	for(i=0,j=a-1;i<=(a-1)/2;i++,j--)//????????
	{
		t=num[i];
		num[i]=num[j];
		num[j]=t;
	}
	for(i=0;i<a;i++)
	{
		cout<<num[i];
	}
	cout<<endl;
	return 0;
}
int main()
{
  int s=0,i,j,h,n,u[10],t,v[10];
  scanf("%d",&n);
  for(i=0;i<=6;i++)
{
	  h=1;
 for(j=1;j<=i;j++)
	 h*=10;
 if(n/h==0)
  break;
}
  
  for(j=i-1;j>=0;j--)
  {
    u[i]=n;
    v[i]=0;
    u[j]=u[j+1]-v[j+1]*pow(10,j+1);
    v[j]=u[j]/pow(10,j);
   
  }
  for(j=0;j<=i-1;j++)
{
s+=v[j]*pow(10,i-1-j);
}
printf("%d",s);

 
  
  return 0;
}
int main(){
	char zfc[100], exc;
	int len, i;
	scanf("%s", zfc);
        len = strlen(zfc);
for(i = 0; i < len/2; i++){
	exc = zfc[i];
	zfc[i] = zfc[len-1-i];
	zfc[len-1-i] = exc;
}

printf("%s", zfc);

	return 0;
}
int main(int argc, char* argv[])
{
	int n,a[5],b[4],c[3],d[2];
	int n1,n2,n3,n4;
	scanf("%d",&n);
	if(n/10000!=0)
	{a[0]=n/10000;
	a[1]=(n-a[0]*10000)/1000;
	a[2]=(n-a[0]*10000-a[1]*1000)/100;
	a[3]=(n-a[0]*10000-a[1]*1000-a[2]*100)/10;
	a[4]=n-a[0]*10000-a[1]*1000-a[2]*100-a[3]*10;
	n1=a[4]*10000+a[3]*1000+a[2]*100+a[1]*10+a[0];
	printf("%d\n",n1);
	}
	if(n/10000==0&&n/1000!=0)
	{b[0]=n/1000;
	b[1]=(n-b[0]*1000)/100;
	b[2]=(n-b[0]*1000-b[1]*100)/10;
	b[3]=n-b[0]*1000-b[1]*100-b[2]*10;
    n2=b[3]*1000+b[2]*100+b[1]*10+b[0];
	printf("%d\n",n2);
	}
	if(n/10000==0&&n/1000==0&&n/100!=0)
	{c[0]=n/100;
	c[1]=(n-c[0]*100)/10;
	c[2]=n-c[0]*100-c[1]*10;
	n3=c[2]*100+c[1]*10+c[0];
	printf("%d\n",n3);
	}
	if(n/10000==0&&n/1000==0&&n/100==0&&n/10!=0)
	{d[0]=n/10;
	d[1]=n-d[0]*10;
	n4=d[1]*10+d[0];
	printf("%d\n",n4);
	}
	if(n/10000==0&&n/1000==0&&n/100==0&&n/10==0)
	{printf("%d\n",n);}
	return 0;
}
int main()
{
	int n,a,b,c,d,e,t;
	scanf("%d",&n);
	if(n<10)
		t=n;
	else if(n<100){
		a=n/10;
		b=n%10;
		t=b*10+a;
	}
	else if(n<1000){
		a=n/100;
		b=n%100/10;
		c=n%10;
		t=c*100+b*10+a;
	}
	else if(n<10000){
		a=n/1000;
		b=n%1000/100;
		c=n%100/10;
		d=n%10;
		t=d*1000+c*100+b*10+a;
	}
	else if(n<100000){
		a=n/10000;
		b=n%10000/1000;
		c=n%1000/100;
		d=n%100/10;
		e=n%10;
		t=e*10000+d*1000+c*100+b*10+a;
	}
	printf("%d\n",t);
	return 0;
}
int main()
{
	int a;
	int m,n,p,q,o,s;
	scanf("%d",&a);
	if(a/10000!=0)
    {
		m=a/10000;
		n=(a-10000*m)/1000;
		o=(a-10000*m-1000*n)/100;
		p=(a-10000*m-1000*n-100*o)/10;
		q=(a-10000*m-1000*n-100*o-10*p)/1;
        s=(10000*q)+(1000*p)+(100*o)+(10*n)+m;
	}
	else if((int)a/10000==0&&a/1000!=0)
    {
		m=a/1000;
		n=(a-1000*m)/100;
		o=(a-1000*m-100*n)/10;
		p=(a-1000*m-100*n-10*o);
		s=(1000*p)+(100*o)+(10*n)+m;
	}
	else if((int)a/1000==0&&a/100!=0)
    {
		m=a/100;
		n=(a-100*m)/10;
		o=(a-100*m-10*n);
		s=(100*o)+(10*n)+m;
	
    }
	else if((int)a/100==0&&a/10!=0)
    {
		m=a/10;
		n=(a-10*m);
		s=(10*n)+m;
	}
	else if((int)a/10==0)
	{	
		s=a;
    }
	printf("%d\n",s);
	return 0;
}
int main(int argc, char* argv[])
{
	int m,x1,x2,x3,x4,x5;
	scanf("%d",&m);
	if(m>9999)
	{
		x5=m/10000;
		x4=(m-x5*10000)/1000;
		x3=(m%1000)/100;
		x2=(m%100)/10;
		x1=m%10;
        printf("%d%d%d%d%d",x1,x2,x3,x4,x5);
		
	}
	else if(m>999)
	{
		x4=m/1000;
		x3=(m%1000)/100;
		x2=(m%100)/10;
		x1=m%10;
        printf("%d%d%d%d",x1,x2,x3,x4);
		
	}
	else  if(m>99)
	{
		x3=m/100;
        x2=(m%100)/10;
		x1=m%10;
        printf("%d%d%d",x1,x2,x3);
		
	}
	else if(m>9)
	{
		x2=m/10;
        x1=m%10;
        printf("%d%d",x1,x2);
		
	}
	else 
	{
		x1=m;
        printf("%d",x1);
		
	}
	
	return 0;
}
void main()
{int a,b,c,d,e,f;
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",f*10000+e*1000+d*100+c*10+b);}
else if (c!=0)
{printf("%d",f*1000+e*100+d*10+c);}
else if (d!=0)
{printf("%d",f*100+e*10+d);}
else if (e!=0)
{printf("%d",f*10+e);}
else if (f!=0)
{printf("%d",f);}
else {printf("0");}
}
int main()
{
	int shu,i,wei[5];
	scanf("%d\n",&shu);
	wei[0]=shu/10000;
	wei[1]=(shu-shu/10000*10000)/1000;
	wei[2]=(shu-shu/1000*1000)/100;
	wei[3]=(shu-shu/100*100)/10;
	wei[4]=(shu-shu/10*10);
	for(i=4;i>=0;i--)
	{
		if(wei[i]!=0)
	    printf("%d",wei[i]);
	}
}
void main()
{
	int i,k;
	char a[5],b[5];
	for(i=0;i<5;i++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n')break;		
	}
	k=i;
	for(i=0;i<k;i++)
		b[i]=a[k-i-1];
	for(i=0;i<k;i++)
		printf("%c",b[i]);
}
int main ()
{
	int a,b,c,d,e,f,g;
	scanf ("%d",&f);
	if (f>=10000)
	{
		a=(f-f%10000)/10000;
		f=f-a*10000;
		b=(f-f%1000)/1000;
		f=f-b*1000;
		c=(f-f%100)/100;
		f=f-c*100;
		d=(f-f%10)/10;
		f=f-d*10;
		e=f;
    	g=e*10000+d*1000+c*100+b*10+a;
	    printf ("%d",g);
	}
	else if (f>=1000)
	{
		b=(f-f%1000)/1000;
		f=f-b*1000;
		c=(f-f%100)/100;
		f=f-c*100;
		d=(f-f%10)/10;
		f=f-d*10;
		e=f;
    	g=e*1000+d*100+c*10+b*1;
    	printf ("%d",g);
	}
	else if (f>=100)
	{
		c=(f-f%100)/100;
		f=f-c*100;
		d=(f-f%10)/10;
		f=f-d*10;
		e=f;
    	g=e*100+d*10+c*1;
    	printf ("%d",g);
	}
	else if (f>=10)
	{
		d=(f-f%10)/10;
		f=f-d*10;
		e=f;
    	g=e*10+d*1;
    	printf ("%d",g);
	}
	else
	{
		e=f;
    	g=e;
    	printf ("%d",g);
	}
}
void main()
{
	int n,a,b,c,d,e,f;
	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);
	if(a>0) f=5;
	else if(b>0) f=4;
    else if(c>0) f=3;
    else if(d>0) f=2;
	else f=1;
	switch(f)
	{case 5 :printf("%d%d%d%d%d",e,d,c,b,a);
	         break;
     case 4 :printf("%d%d%d%d",e,d,c,b);
	         break;
     case 3 :printf("%d%d%d",e,d,c);
	         break;
     case 2 :printf("%d%d",e,d);
	         break;
     case 1 :printf("%d",e);
	         break;
	}
}
int main(int argc, char* argv[])
{
	int n, a, b, c, d, f, x;
	scanf("%d", &n);
	a=(int)n/10000;
	b=(int)(n-10000*a)/1000;
	c=(int)(n-10000*a-1000*b)/100;
	d=(int)(n-10000*a-1000*b-100*c)/10;
	f=(int)(n-10000*a-1000*b-100*c-d*10)/1;
	if(a!=0)
	{x=f*10000+d*1000+c*100+b*10+a;}
    else {
		if(b!=0)
		{x=f*1000+d*100+c*10+b;}
	else{
		if(c!=0)
		{x=f*100+d*10+c;}
    else{
		if(d!=0)
		{x=f*10+d;}
	     else
		 {x=f;}
	}
	}
	}
	printf("%d\n", x);
	return 0;
}
int main(){
	int x,i;
	int n;
	n=0;
	int e[6];
	int s[10];
	scanf("%d",&x);
    s[0]=x;
	while(x>9){
		
		x=x/10;

		n++;
	}
	
	for(i=0;i<=n;i++)
	{
		e[i]=(int)s[i]/pow(10,n-i);

        s[i+1]=s[i]-e[i]*pow(10,n-i);
	}
	for(i=n;i>=0;i--)
	{
		printf("%d",e[i]);
	}
	return 0;
}
int main () 
{
	long n;
	int a[5];
	scanf("%ld", &n);

	int m = (int)log10(n);
	int i;	
	for (i = 0; i <= m; i++)
	{
		a[i] = n  % 10;
		n = n / 10;
	}
	for(i = 0; i <= m; i++)
	{
		printf("%d", a[i]);
	}
	printf("\n");
	return 0;
}
int main(){
int n;
scanf("%d",&n);
if(n>=10000){
int a,b,c,d,e,k;
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;
k=e*10000+d*1000+c*100+b*10+a;
printf("%d",k);
}
else if(n<10000&&n>=1000){
int a,b,c,d,k;
a=n/1000;
b=(n-a*1000)/100;
c=(n-a*1000-b*100)/10;
d=n-a*1000-b*100-c*10;
k=d*1000+c*100+b*10+a;
printf("%d",k);
}
else if(n>=100){
int a,b,c,k;
a=n/100;
b=(n-a*100)/10;
c=n-a*100-b*10;
k=c*100+b*10+a;
printf("%d",k);
}
else if(n>=10){
int a,b,k;
a=n/10;
b=n-a*10;
k=b*10+a;
printf("%d",k);
}
else{printf("%d",n);}
return 0;
}
main()
{
   int i,chang;
   char a[5]={'\0'},b[5]={'\0'};
   scanf("%s",a);
   chang=strlen(a);
   for(i=0;i<chang;i++)
   {
   	b[i]=a[chang-i-1];
   }
   for(i=0;i<chang;i++)
   printf("%c",b[i]);
}
main()
{
	int a;
	scanf("%d",&a);
	if(a/10==0) printf("%d",a);
	else if(a/100==0) {
		int b, c;
		b=a%10; c=a/10; printf("%d%d\n",b,c);
	}
	else if(a/1000==0) {
		int b, c, d;
		b=a%10; c=a/10%10; d=a/100; printf("%d%d%d\n",b,c,d);
	}
	else if(a/10000==0) {
		int b, c, d, e;
		b=a%10; c=a/10%10; d=a/100%10; e=a/1000%10; printf("%d%d%d%d\n",b,c,d,e);
	}
	else if(a/100000==0) {
		int b, c, d, e, f;
		b=a%10; c=a/10%10; d=a/100%10; e=a/1000%10; f=a/10000%10; printf("%d%d%d%d%d\n",b, c, d, e, f);
	}
	else printf("error\n");
}
int main(int argc, char* argv[])
{
    int n,a,b,c,d,e,x;
	scanf("%d",&n);
	a=(int)n/10000;
	b=(int)(n-10000*a)/1000;
	c=(int)(n-10000*a-1000*b)/100;
	d=(int)(n-10000*a-1000*b-100*c)/10;
	e=(int)(n-10000*a-1000*b-100*c-10*d)/1;
	if(a!=0) x=e*10000+d*1000+c*100+b*10+a;
	else {if (b!=0) x=e*1000+d*100+c*10+b; 
		  else {if (c!=0) x=e*100+d*10+c;
		  else {if (d!=0) x=e*10+d;
		  else x=e;}}}
    printf("%d\n",x);
	return 0;
}
int main()
{
    char num[7];
    gets(num);
    int i;
    for (i=1;i<=strlen(num);i++)
        printf("%c",num[strlen(num)-i]);
    printf("\n");
    
}
void main()
{
int a,b,c,d,e,f;
scanf("%d",&a);

if(a/10000>=1&&a/10000<10)
{f=a%10;e=(a%100-f)/10;d=(a%1000-e*10-f)/100;c=(a%10000-d*100-e*10-f)/1000;b=(a%1000000-c*1000-d*100-e*10-f)/10000;
printf("%d%d%d%d%d\n",f,e,d,c,b);}
else if(a/1000>=1&&a/1000<10)
{f=a%10;e=(a%100-f)/10;d=(a%1000-e*10-f)/100;c=(a%10000-d*100-e*10-f)/1000;
printf("%d%d%d%d\n",f,e,d,c);}
else if(a/100>=1&&a/100<10)
{f=a%10;e=(a%100-f)/10;d=(a%1000-e*10-f)/100;
printf("%d%d%d\n",f,e,d);}
else if(a/10>=1&&a/10<10)
{f=a%10;e=(a%100-f)/10;
printf("%d%d\n",f,e);}
else if(a>=1&&a<=10)
{f=a%10;
printf("%d\n",f);}
else
printf("error\n");
}
void main()
{
	char s[5],t;
	int i,n;
	scanf("%s",s);
	n=strlen(s);
	for(i=0;i<n/2;i++)
	{
		t=s[n-i-1];
		s[n-i-1]=s[i];
		s[i]=t;
	}
	for(i=0;i<n;i++)
	printf("%c",s[i]);
}
void main()
{
	int n,a,b,c,d,e,m;
	scanf("%d",&n);
	if(n>10000)
	
	{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;
m=e*10000+d*1000+c*100+b*10+a;
	}
	else if(n>1000)
		{a=n/1000;
       b=(n-a*1000)/100;
        c=(n-a*1000-b*100)/10;
       d=n-a*1000-b*100-c*10;
       m=d*1000+c*100+b*10+a;}
	else
	{a=n/100;
      b=(n-a*100)/10;
      c=(n-a*100-b*10);

      m=c*100+b*10+a;}
	
	


printf("%d",m);
}
int main()
{
	char input[20]={0},i=0;
	while(scanf("%c",&input[i])!=-1&&input[i]!='\n')
		i++;
	for(i--;i>=0;i--)
		printf("%c",input[i]);
	printf("\n");
}
int main()
{
	int n,a,b,c,d,e,x;
	scanf("%d",&n);
	if(n>10000)
	{
		a=n/10000;
	    b=(n-10000*a)/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;
		x=e*10000+d*1000+c*100+b*10+a;
	}
    if(n>10000)
	{
		a=n/10000;
	    b=(n-10000*a)/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;
		x=e*10000+d*1000+c*100+b*10+a;
	}
    if(n>1000&&n<10000)
	{
		b=n/1000;
	    c=(n-b*1000)/100;
	    d=(n-b*1000-c*100)/10;
	    e=n-b*1000-c*100-d*10;
		x=e*1000+d*100+c*10+b;
	}
    if(n>100&&n<1000)
	{
		c=n/100;
	    d=(n-c*100)/10;
	    e=n-c*100-d*10;
		x=e*100+d*10+c;
	}
    if(n>10&&n<100)
	{
	    d=n/10;
	    e=n-d*10;
		x=e*10+d;
	}
	if(n>0&&n<10)
		x=n;
	printf("%d",x);
}
void main()
{
	int b,ch,i,a[5];
	i=0; 
	b=0;

	while ((ch=getchar())!='\n')
	{
		a[i]=ch-48;
		i++;
		b++;
	}

	for (i=b-1;i>=0;i--)
		printf("%d",a[i]);

	
}
int main(){
	int n,m=0,a=0;
	scanf("%d",&n);
	while(n!=a){
		a=n%10;
		if(a==n)
			break;
		else{
			m=m*10+a*10;
		}
		n=n/10;
	}
	m=m+a;
	printf("%d",m);
	return 0;
}
int main ()
{
  int n;
  scanf("%d",&n);
  if(n/10000!=0){
       n = n/10000+((n%10000)/1000)*10+((n%1000)/100)*100+((n%100)/10)*1000+(n%10)*10000;
       }
  if(n/10000==0 && n/1000!=0){ 
        n = n/1000+((n%1000)/100)*10+((n%100)/10)*100+(n%10)*1000;
       }
   if(n/10000==0 && n/1000==0 && n/100!=0){ 
        n = n/100+((n%100)/10)*10+(n%10)*100;
       }
   if(n/10000==0 && n/1000==0 && n/100==0 && n/10!=0){ 
        n = n/10+(n%10)*10;
       }
    printf("%d",n);                                                            
  return 0;
}
void main()
{
    int a,b,c,d,e,n,x;
    scanf("%d",&x);
    if (x<0&&x>99999)
       printf("error\n");
       else if (x>=10000)
            n=5;
       else if (x>=1000)
            n=4;
       else if (x>=100)
            n=3;
       else if (x>=10)
            n=2;
       else 
            n=1;
       a=(int)(x)/10000;
       b=(int)(x-a*10000)/1000;
       c=(int)(x-a*10000-b*1000)/100;
       d=(int)(x-a*10000-b*1000-c*100)/10;
       e=(int)(x-a*10000-b*1000-c*100-d*10);
       switch(n)
      {
       case 5:printf("%d%d%d%d%d",e,d,c,b,a);
              break;
       case 4:printf("%d%d%d%d",e,d,c,b);
              break;
       case 3:printf("%d%d%d",e,d,c);
              break;
       case 2:printf("%d%d",e,d);
              break;
       case 1:printf("%d",e);
              break;  
      }
 }
int main()
{
	int n,i,N,a[5];
	scanf("%d",&n);
N=(int)(log10(n))+1;
	for (i=0;i<N;i++)
	{
		a[i]=n%10;
		n=(n-a[i])/10;
		printf("%d",a[i]);
	}


   return 0;
}
int 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;
  
  printf("%d",e);
  if(d!=0)
  {printf("%d",d);}
  if(c!=0)
  {printf("%d",c);}
  if(b!=0)
  {printf("%d",b);}
  if(a!=0)
  {printf("%d",a);}

  return 0;  
  
}
void main()
{
	int a,b,c,d,e;
	long int m,y;
    scanf("%ld",&m);
    a=m%10;
    b=(m%100-m%10)/10;
    c=(m%1000-m%100)/100;
    d=(m%10000-m%1000)/1000;
    e=(m%100000-m%10000)/10000;
    if(e!=0)
	{
    	y=a*10000+b*1000+c*100+d*10+e;
		printf("%ld",y);
	}
    else
	{
	    if(d!=0)
		{
		y=a*1000+b*100+c*10+d;
		printf("%d",y);
		}
	    else
		{
		    if(c!=0)
			{
			y=a*100+b*10+c;
			printf("%d",y);
			}
		    else
			{
			    if(b!=0)
				{
				y=a*10+b;
				printf("%d",y);
				}
			    else
				{
			    	y=a;
					printf("%d",y);
				}
			}
		}
	}
}
void main()
{
	int b;
    long n;
	scanf("%d",&n);
	while(n>9)
	{
		b=n%10;
		printf("%d",b);
		n=n/10;
	}
	printf("%d\n",n);
}
void main()
{
	int i;
	char a[5];
	gets(a);
	for(i=4;i>=0;i--)
	{
		if(a[i]!='\0')
			printf("%c",a[i]);
	}
}