semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int n, a, b, c, d, e, f, g;
	scanf("%d", &n);
	if(n>100000){
		a=n/100000;
		b=(n%100000)/10000;
		c=(n%10000)/1000;
		d=(n%1000)/100;
		e=(n%100)/10;
		f=n%10;
		g=a+b*10+c*100+d*1000+e*10000+f*100000;
	}
	if(n>10000&&n<100000){
        b=n/10000;
		c=(n%10000)/1000;
		d=(n%1000)/100;
		e=(n%100)/10;
		f=n%10;
		g=b+c*10+d*100+e*1000+f*10000;
	}
	if(n>1000&&n<10000){
        c=n/1000;
		d=(n%1000)/100;
		e=(n%100)/10;
		f=n%10;
		g=c+d*10+e*100+f*1000;
	}
	if(n>100&&n<1000){
        d=n/100;
		e=(n%100)/10;
		f=n%10;
		g=d+e*10+f*100;
	}
	if(n>10&&n<100){
        e=n/10;
		f=n%10;
		g=e+f*10;
	}
	if(n<10){
		g=n;
	}
	printf("%d", g);
	return 0;
}
main()
{int a[6],l,i;

l=1;
 while(scanf("%1d",&a[l])==1)l++;
 l--;
 for(i=l;i>=1;i--)printf("%d",a[i]);
}
int fun(int m)
{
	long int a,b,c,d,e,n;
	a=m/10000;
	b=m/1000-10*a;
	c=m/100-100*a-10*b;
	d=m/10-1000*a-100*b-10*c;
	e=m-10000*a-1000*b-100*c-10*d;
	if ((a+b+c+d)==0)	n=e;
	else if ((a+b+c)==0) n=10*e+d;
	else if ((a+b)==0) n=100*e+10*d+c;
	else if (a==0) n=1000*e+100*d+10*c+b;
	else n=10000*e+1000*d+100*c+10*b+a;
	return n;
}

int main()
{
	int i,a;
	for (i=0;i<100;++i) if (cin>>a) cout<<fun(a)<<endl;
	return 0;
}
int main()
{
	int n,i,a,b=0;
	scanf("%d",&n);
	for(i=0;i<=4;i++)
	{
		a=n%10;
		n=n/10;
		
		b=10*b+a;
		if(n==0)
			break;
	}
	printf("%d\n",b);
	return 0;
}
void main()
{
char a[5],i,p;
for(i=0;i<5;i++)
scanf("%c",&a[i]);
p=0;
for(i=0;i<5;i++)
{
	if(a[i]!='\n')
		p=p+1;
}
for(i=p-1;i>=0;i--)
printf("%c",a[i]);
}
int main()
{
	long int n;
	int a,b,c,d,e,p;
	scanf("%ld",&n);
	if(n>9999)
		p=5;
	else
	{
		if(n>999&&n<=9999)
			p=4;
		else
		{
			if(n>99&&n<=999)
				p=3;
			else
			{
				if(n>9&&n<=99)
					p=2;
				else
					p=1;
			}
		}
	}
	switch(p)
	{
	case 5:
		a=n/10000;
		b=(n-a*10000)/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)/1;
		printf("%d%d%d%d%d",e,d,c,b,a);
		break;
	case 4:
		b=n/1000;
		c=(n-1000*b)/100;
		d=(n-1000*b-100*c)/10;
		e=(n-1000*b-100*c-10*d)/1;
		printf("%d%d%d%d",e,d,c,b);
		break;
	case 3:
		c=n/100;
		d=(n-100*c)/10;
		e=(n-100*c-10*d)/1;
		printf("%d%d%d",e,d,c);
		break;
	case 2:
		d=n/10;
		e=(n-10*d)/1;
		printf("%d%d",e,d);
		break;
	case 1:
		e=n/1;
		printf("%d",e);
	}
	return 0;
}
void main()
{
	int n,a,b,c,d,e,x;
	scanf("%d",&n);
	a=floor(n/10000);
	b=floor((n-10000*a)/1000);
	c=floor((n-10000*a-1000*b)/100);
	d=floor((n-10000*a-1000*b-100*c)/10);
	e=n-10000*a-1000*b-100*c-10*d;
	if(a!=0&&b!=0&&c!=0&&d!=0) x=10000*e+1000*d+100*c+10*b+a;
	if(a==0&&b!=0&&c!=0&&d!=0) x=1000*e+100*d+10*c+b;
	if(a==0&&b==0&&c!=0&&d!=0) x=100*e+10*d+c;
	if(a==0&&b==0&&c==0&&d!=0) x=10*e+1*d;
	if(a==0&&b==0&&c==0&&d==0) x=e;
	printf("%d\n",x);
}
int n=0;
void main()
{
	int a,f=0;
	int v(int z);
	int s(int x);
	int h(int y);
	scanf("%d",&a);
	f=v(a);
	printf("%d",f);
}
int s(int x)
{
	int b;
	if (x>9999) b=x/10000;
	else if(x>999) b=x/1000;
	else if(x>99)  b=x/100;
	else if(x>9)  b=x/10;
	else b=x;
	return(b);
}
int h(int y)
{
int b;
	if (y>9999) b=fmod(y,10000);
	else if(y>999) b=fmod(y,1000);
	else if(y>99)  b=fmod(y,100);
	else if(y>9)  b=fmod(y,10);
	else b=0;
	return(b);
}
int v(int z)
{
	int n;
    if (z<10) n=z;
	else n=v(h(z))*10+s(z);
	return(n);
}
int main()
{
	int i,j=0,a;
	char n[5],w[6];
	scanf("%s",n);
	a=(int)strlen(n);
	for(i=a-1;i>=0;i--){
	
			w[j]=n[i];
			j++;
	}
	w[j]=0;
	
    printf("%s",w);
	return 0;
}
int main()
{
    int x,a,b,c,d,e;
	scanf("%d",&x);
	a=x/10000;
	b=x/1000-10*a;
	c=x/100-100*a-10*b;
	d=x/10-1000*a-100*b-10*c;
	e=x%10;
	if (a!=0)
	printf("%d%d%d%d%d",e,d,c,b,a);
	else if (b!=0)
		printf("%d%d%d%d",e,d,c,b);
	else if (c!=0)
		printf("%d%d%d%",e,d,c);
    else if (d!=0)
		printf("%d%d",e,d);
	else printf("%d",e);
    return 0;
}
void main()
{
	long int a,b,c,d,e,x,y;
	scanf("%5ld",&x);
	if(x>9999)
	{
		a=x/10000;
		b=x/1000%10;
		c=x/100%10;
		d=x/10%10;
		e=x%10;
		y=10000*e+1000*d+100*c+10*b+a;
		printf("%ld\n",y);
	}
	if(x>999&&x<=9999)
	{
		a=x/1000;
		b=x/100%10;
		c=x/10%10;
		d=x%10;
		y=1000*d+100*c+10*b+a;
		printf("%ld\n",y);
	}
	if(x>99&&x<=999)
	{
		a=x/100;
		b=x/10%10;
		c=x%10;
		y=100*c+10*b+a;
		printf("%ld\n",y);
	}
		if(x>9&&x<=99)
	{
		a=x/10;
		b=x%10;
		y=10*b+a;
		printf("%ld\n",y);
	}
		if(x>0&&x<=9)
	{
		a=x;
		y=a;
		printf("%ld\n",y);
	}
}
int main()
{
	int a, b;
	scanf("%d", &a);
	if(a-0>=0&&a-10<0){
		b=a;
	}
	else if(a-10>=0&&a-100<0){
		b=a%10*10+a/10;
	}
	else if(a-100>=0&&a-1000<0){
		b=a%10*100+(a%100-a%10)+a/100;
	}
	else if(a-1000>=0&&a-10000<0){
		b=a%10*1000+(a%100-a%10)*10+(a%1000-a%100)/10+a/1000;
	}
	else if(a-10000>=0&&a-100000<0){
		b=a%10*10000+(a%100-a%10)*100+(a%1000-a%100)+(a%10000-a%1000)/100+a/10000;
	}	
	printf("%d", b);
	return 0;
}
int main(int argc, char* argv[])
{
	int n, i = 1, a[5] = {-1,-1,-1,-1,-1}, m = 0;
	scanf("%d", &n);
    while (i < n)
	{
		a[m] = (int)((n%(i*10))/i);
		i *= 10;
		m++;
	}
	for (i=0;i<5;i++)
	{
		if (a[i] != -1)
			printf("%d", a[i]);
	}
	return 0;
}
int main()
{
	int n,i,scores[5],a,m;
	scanf("%d",&n);
	if(n>0&&n<10)
		a=1;
	else if(n>=10&&n<100)
		a=2;
	else if(n>=100&&n<1000)
		a=3;
	else if(n>=1000&&n<10000)
		a=4;
	else if(n>=10000&&n<=99999)
		a=5;
	for(i=a-1;i>=0;i--)
	{
		m=pow(10,i);
		scores[i]=n/m;
		n=n-scores[i]*m;
	}
	for(i=0;i<a;i++)
	{
		printf("%d",scores[i]);
	}
	return 0;
}
void main()
{
	int n,a1,a2,a3,a4,a5,m;
	scanf("%d",&n);
	a1=n/10000;
	a2=(n-10000*a1)/1000;
	a3=(n-10000*a1-1000*a2)/100;
	a4=(n-10000*a1-1000*a2-100*a3)/10;
	a5=n%10;
	if(a1!=0)
		m=10000*a5+1000*a4+100*a3+10*a2+a1;
	else if(a2!=0)
		m=1000*a5+100*a4+10*a3+a2;
	else if(a3!=0)
		m=100*a5+10*a4+a3;
	else if(a4!=0)
		m=10*a5+a4;
	else
		m=a5;
	printf("%d",m);
}
void main()
{
	int a,b,c,d,e,f,x,y;
	scanf("%d",&x);
	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);
if(a==0)
{
	if(b!=0)
	{
		y=e*1000+d*100+c*10+b*1+a;
		printf("%d",y);
	}
	else
	{
		if(c!=0)
		{
		y=e*100+d*10+c*1;
		printf("%d",y);
		}
		else
		{
			if(d!=0)
			{
				y=e*10+d;
				printf("%d",y);
			}
			else
			{
				if(e!=0)
				{
				y=e;
				printf("%d",y);
				}
				else
					printf("wrong");
			}
		}
	}
}
else
{
	y=e*10000+d*1000+c*100+b*10+a;
	printf("%d",y);
}
}
int main()
{
	int b,a[5];
	scanf("%d",&b);
	if((b/10000)>=1)
	{
		a[0]=b/10000;
		a[1]=(b-10000*a[0])/1000;
		a[2]=(b/100)%10;
		a[3]=(b/10)%10;
		a[4]=b%10;
		printf("%d",a[4]*10000+a[3]*1000+a[2]*100+a[1]*10+a[0]);
	}
	else if((b/1000)>=1)
	{   a[1]=b/1000;
		a[2]=(b/100)%10;
		a[3]=(b/10)%10;
		a[4]=b%10;
		printf("%d",a[4]*1000+a[3]*100+a[2]*10+a[1]);
	}
	else if((b/100)>=1)
	{
		a[1]=b/100;
		a[2]=(b/10)%10;
		a[3]=b%10;
		printf("%d",a[3]*100+a[2]*10+a[1]);
	}
	else if(b<100)
	{
		a[1]=b/10;
		a[2]=b%10;
		printf("%d",a[2]*10+a[1]);
	}
	return 0;
}
int main()
{
	int a,b=0;
	scanf("%d",&a);
	do
	{
		b=b*10+a%10;
		a/=10;
	}
	while(a>0);
	printf("%d\n",b);
	return 0;
}
int main()
{	
	long int n;
	int x1,x2,x3,x4,x5;

	scanf("%ld",&n);
	x1=n/10000;
    x2=(int)(n-x1*10000)/1000;
	x3=(int)(n-x1*10000-x2*1000)/100;
	x4=(int)(n-x1*10000-x2*1000-x3*100)/10;
	x5=(int)(n-x1*10000-x2*1000-x3*100-x4*10);
	if(n>9999)
		printf("%d%d%d%d%d",x5,x4,x3,x2,x1);
	else if(n>999)
		printf("%d%d%d%d",x5,x4,x3,x2);
	else if(n>99)
		printf("%d%d%d",x5,x4,x3);
	else if(n>9)
		printf("%d%d",x5,x4);
	else printf("%d",x5);
	return 0;
}
void main()
{
	int a[10];
	int i=1,j,m,n,k,sum=0,t=1;
	scanf("%d",&m);
    for(i=0;i<=5;i++)
	{
	 	if(t<=m&&m<t*10)
		{
		  k=i+1;
		  break;
		}
		t*=10;
	}
	for(j=k-1;j>=0;j--)
	{
		a[j] = m%10;
		m = m/10;
	}
	for(n=k-1;n>=0;n--)
	{
		sum=sum+a[n];
		sum*=10;
	}
	sum=sum/10;
	printf("%d\n",sum);
}
int main(int argc, char* argv[])
{
	int a,b=0;
	scanf("%d",&a);
    while(a>9)
	{
		b=(a-a/10*10)*10+b*10;
		a=a/10;
	}
	b=b+a;
	printf("%d",b);
	return 0;
}
void main ()
{
	int a,b,c,e,f,g,h;
	scanf("%d",&h);
	g=log10(h)+1;
	f=h/10000;
	e=(h-10000*f)/1000;
	c=(h-10000*f-1000*e)/100;
	b=(h-10000*f-1000*e-100*c)/10;
	a=h-10000*f-1000*e-100*c-10*b;
	switch (g)
	{
	case 5:printf("%d%d%d%d%d",a,b,c,e,f);break;
	case 4:printf("%d%d%d%d",a,b,c,e);break;
	case 3:printf("%d%d%d",a,b,c);break;
	case 2:printf("%d%xd",a,b);break;
	case 1:printf("%d",a);
	}
}
long fang(long x);  
 void main() 
 
 { 
 
 
 
 long sum,a,b,i,t,s,p; 
 
 sum=0; 
 
 scanf("%d",&a); 
 
 i=4; 
 
 p=10000; 
 
 s=a/p; // s=a/p; b=a%p;
 
 
 
 while(s==0) 
 
 { 

 i=i-1; 
 
 p=fang(i); 
 
 s=a/p; // s=b/p; b=b%p;
 
 } 
 
 
 
 t=i; 
 
 
 
 while(t>=0) 
 
 { 
 
 b=a%10; 
 
 a=a/10; 
 
 sum=sum+fang(t)*b; 
 
 t=t-1; 
 
 }
 
 
 
 printf("%d",sum); 
 
 } 
 
 
 
 long fang(long x) 
 
 { 
 
 long i,y; 
 
 i=1; 
 
 y=1; 
 
 while(i++<=x)     //  while(i++<=x)
 
 y=y*10; 
 
 return(y); 
 
 }
void main()
{
	int a,b,c,d,e,k,l;
	scanf("%d",&k);
	e=k%10;
          d=(k%100-e)/10;
         c=(k%1000-d*10-e)/100;
         b=(k%10000-c*100-d*10-e*1)/1000;
         a=(k%100000-b*1000-c*100-d*10-e*1)/10000; 
	if(a!=0)
	{
		l=e*10000+d*1000+c*100+b*10+a;
		printf("%d",l);
	}
	else if(b!=0)
	{	
		l=e*1000+d*100+c*10+b;
		printf("%d",l);
	}
	else if(c!=0)
	{	
                  l=e*100+d*10+c*1;
		printf("%d",l);
    }
	else if(d!=0)
	{
		l=e*10+d;
		printf("%d",l);
    }
	else if(e!=0)
	{	
         		l=e;
		printf("%d",l);
    }
	else
	{
		printf("error");
    }
}
void main()
{
    int a;
	scanf("%d",&a);
    if (a<10)
		printf("%d",a);
    else if (a<100)
	    printf("%d",10*(int)(a-10*(int)(a/10))+(int)(a/10));
	else if (a<1000)
	    printf("%d",100*(int)(a-10*(int)(a/10))+10*(int)((a-100*(int)(a/100))/10)+(int)(a/100));
	else if (a<10000)
	    printf("%d",1000*(int)(a-10*(int)(a/10))+100*(int)((a-100*(int)(a/100))/10)+10*(int)((a-1000*(int)(a/1000))/100)+(int)(a/1000));
	else if (a<100000)
	    printf("%d",10000*(int)(a-10*(int)(a/10))+1000*(int)((a-100*(int)(a/100))/10)+100*(int)((a-1000*(int)(a/1000))/100)+10*(int)((a-10000*(int)(a/10000))/1000)+(int)(a/10000));
}
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;
  if(a!=0) printf("%d%d%d%d%d",e,d,c,b,a);
  else{
     if(b!=0) printf("%d%d%d%d",e,d,c,b);
       else{
        if(c!=0) printf("%d%d%d",e,d,c);
         else{
          if(d!=0) printf("%d%d",e,d);
           else printf("%d",e);}
           }
        }
}
void main()
{
	int n,i=0;
	char a[10],b[10];
	scanf("%s",&a);
	while(a[i]!='\0')
	{
		i++;
	}
	n=i-1;
	for(i=0;i<=n;i++)
	{
		b[i]=a[n-i];		
	}
	b[n+1]='\0';	printf("%s\n",b);
}
int main()
{
	long a;
		scanf("%d",&a);
    int b,c,d,e,f;
	b=a/10000;
	c=(a-b*10000)/1000;
	d=(a-b*10000-c*1000)/100;
	e=(a-b*10000-c*1000-d*100)/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))
			   printf("%d%d%d",f,e,d);
		   else
			   if(!(e==0))
                   printf("%d%d",f,e);
			   else
				   printf("%d",f);
				   return 0;
}
int main()                                        //???
{                                                 //?????
	int a,b[5],i;                                 //????a,i???,??b[5]???
	cin>>a;                                       //????a
	b[0]=a%10;                                    //??b[0]??a????
	b[1]=((a-b[0])%100)/10;                       //??b[1]??a??????
	b[2]=((a-b[0]-10*b[1])%1000)/100;             //??b[2]??a??????
	b[3]=((a-b[0]-10*b[1]-100*b[2])%10000)/1000;  //??b[3]??a??????
	b[4]=((a-b[0]-10*b[1]-100*b[2]-b[3]*1000)%100000)/10000;       //??b[4]??a??????
	for(i=0;i<5;i++)                              //i???
	{
		if(b[i]!=0)                               //?????
	cout<<b[i];                                   //?i?????????b[i]
	}
	return 0;                                      //?????????????????
}                                                  //?????
void main()
{
	unsigned int x;
    scanf("%d",&x);
    if(x<=9) printf("%d",x);
    else if(x<=99)
	{
    int a,b;
	a=x/10;
	b=x-10*a;
	printf("%d%d\n",b,a);
	}
	else if(x<=999)
	{
		int a,b,c;
		a=x/100;
		b=(x-100*a)/10;
		c=x-100*a-10*b;
	printf("%d%d%d\n",c,b,a);
	}
	else if(x<=9999)
	{
		int a,b,c,d;
		a=x/1000;
		b=(x-1000*a)/100;
		c=(x-1000*a-100*b)/10;
		d=x-1000*a-100*b-10*c;
	printf("%d%d%d%d\n",d,c,b,a);
	}
    else if(x<=99999)
	{
		int a,b,c,d,e;
		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-10000*a-1000*b-100*c-10*d);
		printf("%d%d%d%d%d\n",e,d,c,b,a);
	}
}
int main()
{
	char input[20]={0},i=0,len;
	while(scanf("%c",&input[i])!=-1&&input[i]!='\n')
		i++;
	for(i--;i>=0;i--)
		printf("%d",input[i]-'0');
	printf("\n");
}
void main()
{
	long int n;
	long int a[5],i,j,k,b[6];
	b[0]=1,b[1]=10,b[2]=100,b[3]=1000,b[4]=10000,b[5]=100000;
	scanf("%ld",&n);
	for(i=4;i>=0;i--)
	{
		a[i]=n%b[i+1];
		a[i]=a[i]/b[i];
		if((n/b[i])==0)
			a[i]=10;
	}
	for(i=0;i<5;i++)
	{
		if(a[i]<10)
		{
			printf("%ld",a[i]);
		}
	}
}
//?????(???5?)?????????????123???321
//???????5?????????????????0??
//?????????
int main()
{
	int n,a,b,c,d,e,m;                      //n??????a?b?c?d?e???n????????????m?n?????
	cin>>n;                                 //???n
	if(9999<n&n<=99999)                     //n?5???
	{
		e=n/10000;                          //????
		d=(n-e*10000)/1000;                 //????
		c=(n-e*10000-d*1000)/100;           //????
		b=(n-e*10000-d*1000-c*100)/10;      //????
		a=n-e*10000-d*1000-c*100-b*10;      //????
		m=e+10*d+100*c+1000*b+10000*a;      //??????
		cout<<m;                            //????
	}
	else if(999<n&n<=9999)                  //n?????
	{
		d=n/1000;
		c=(n-d*1000)/100;
		b=(n-d*1000-c*100)/10;
		a=n-d*1000-c*100-b*10;
		m=d+10*c+100*b+1000*a;
		cout<<m;
	}
	else if(99<n&n<=999)                    //n?????
	{
		c=n/100;
		b=(n-c*100)/10;
		a=n-c*100-b*10;
		m=c+10*b+100*a;
		cout<<m;
	}
	else if(n<=99&n>9)                      //n?????
	{
		b=n/10;
		a=n-10*b;
		m=b+10*a;
		cout<<m;
	}
	else if(n<=9)cout<<n;                   //n?????
	return 0;
}
int main(int argc, char* argv[])
{
	int n;
	int a,b,c,d,e,f;
	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-n%10000)/10000;
	if(n/10==0)
	{
		f=a;
	}
	else if(n/100==0)
	{
		f=10*a+b;
	}
else	if(n/1000==0)
	{
		f=100*a+10*b+c;
	}
	else if(n/10000==0)
	{
		f=1000*a+100*b+10*c+d;
	}
	else if(n/100000==0)
	{
		f=10000*a+1000*b+100*c+10*d+e;
	}

	printf("%d\n",f);
	return 0;
}
void main()
{
	char a[10];
	int i,j;
	for (i=0;;i++)
	{
		a[i]=getchar();
		if (a[i]=='\n') break;
	}
	j=i-1;
	for (i=j;i>=0;i--)
		printf("%c",a[i]);
}
int main()
{
	int n,i,j=0,t;
	char a[6];
	scanf("%s",a);
	for(i=0;i<6;i++)
	{
		if(a[i]=='\0')
			break;
		j=j+1;	
	}
	for(i=0;i<=(j-1)/2;i++)
	{
		t=a[j-1-i];
		a[j-1-i]=a[i];
		a[i]=t;
	}
	for(i=0;i<=j;i++)
	{
		if(a[i]=='\0')
			break;
		printf("%c",a[i]);
	}
	return 0;
}
int main(int argc, char* argv[])
{
	int n;
	int a,b,c,d,e;
	scanf("%d",&n);
    a=(int)n/10000;
	b=(int)(n-a*10000)/1000;
	c=(int)(n-a*10000-b*1000)/100;
	d=(int)(n-a*10000-b*1000-c*100)/10;
	e=(int)(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);
	if(a==0 && b!=0 && c!=0 && d!=0)
		printf("%d%d%d%d\n",e,d,c,b);
	if(a==0 && b==0 && c!=0 && d!=0)
		printf("%d%d%d\n",e,d,c);
	if(a==0 && b==0 && c==0 && d!=0)
		printf("%d%d\n",e,d);
	if(a==0 && b==0 && c==0 && d==0)
		printf("%d\n",e);
	return 0;
}
int main()
{
    char a[6];
    int c;
    int i=0;
    do
    {
         c=getchar();
         a[i]=c;
          i++;
    }
    while (c!='\n');
    i-=2;
    for (;i>=0;i--)
    {
        cout<<a[i];
    }
}
int main(){
	int s;
	scanf("%d",&s);
	int a,b,c,d,e;
	a=s%10;
	b=(s%100)/10;
	c=(s%1000)/100;
	d=(s%10000)/1000;
	e=(s%100000)/10000;
	if(a!=0){
		printf("%d",a);
	}
	if(b!=0){
		printf("%d",b);
	}
	if(c!=0){
		printf("%d",c);
	}
	if(d!=0){
	    printf("%d",d);
	}
	if(e!=0){
		printf("%d",e);
	}
	return 0;
}
void main()
{
	char a[10],b[10]="";
	int i,j,k,n;
	scanf("%s",a);
	n=strlen(a);
	for (i=0;i<=n-1;i++)
		b[i]=a[n-i-1];
	puts(b);
}
void main()
  {
     int a,b,c,d,e,x;
	 scanf("%d",&x);
	     e=x%10; 
	     d=((x-e)/10)%10;

    c=((x-d*10-e)/100)%10;

 b=((x-10*d-e-100*c)/1000)%10;
    a=((x-b*1000-c*100-d*10-e)/10000)%10;

if (a!=0)
    printf("%d%d%d%d%d",e,d,c,b,a);
    else if (b!=0)
		printf("%d%d%d%d",e,d,c,b);
 else if (c!=0)
		printf("%d%d%d",e,d,c);
     


 else if (d!=0)
		printf("%d%d",e,d);
 else if (e!=0)
		printf("%d",e);

    else printf("0");





  }
void echo()
{
	char c1;
	scanf("%c",&c1);
	if(c1!='\n')
	echo();
	printf("%c",c1);
}
   int main()
   {echo();}
void main()
{
	int a[10],b[100],i,j,n;
	scanf ("%d",&a[0]);
	for (i=1;i<10;i++) a[i]=a[i-1]/10; 
	for (i=0,n=0;i<10;i++) if (a[i]!=0) n=n+1;
	for (i=0,j=0;j<n;i++,j++) {b[j]=a[i]%10; printf("%d",b[j]);}
	
}
int main(){
int a,i=1,j=1;
scanf("%d",&a);
while(i*=10)
  if(a/i==0) break;

while(j<i){
  printf("%d",(a/j)%10);
  j*=10;
}
}
int main()
{
	char str[80],*p,*q,t;
	scanf("%s", str);
	for(p=str,q=p+strlen(str)-1;p<q;p++,q--)
	{
		t=*p;
		*p=*q;
		*q=t;
	}
	printf("%s", str);
	return 0;
}
int main(int argc, char* argv[])
{
	int a,b,c,d,e,f,s,g,i,h;
    scanf("%d",&a);
    if(a>10000)
	{
        b=a/10000;
		c=a%10000;
		d=c/1000;
		e=c%1000;
		f=e/100;
		g=e%100;
		s=g/10;
        h=g%10;
        i=h*10000+s*1000+f*100+d*10+b;
			printf("%d",i);
	}
    else if(a>1000)
	{
		b=a/1000;
	    c=a%1000;
     	d=c/100;
    	e=c%100;
    	f=e/10;
	    g=e%10;
		i=g*1000+f*100+d*10+b;
			printf("%d",i);
	}
	else if(a>100)
	{
	b=a/1000;
	    c=a%1000;
     	d=c/100;
    	e=c%100;
    	f=e/10;
	    g=e%10;
		i=g*100+f*10+d;
			printf("%d",i);
	}
	else if(a>10)
	{
	b=a/1000;
	    c=a%1000;
     	d=c/100;
    	e=c%100;
    	f=e/10;
	    g=e%10;
		i=g*10+f;
			printf("%d",i);
	}
	return 0;
}
int main()
{
    int a[4],i; 
    int b[4]={0}; 
    for(i=0;i<=3;i++)
    scanf("%d",&a[i]); 
    for(i=0;i<=3;i++)
	{
	 while(a[i]>9)
	{ 
	 b[i]=(b[i]+a[i]-a[i]/10*10)*10; 
          a[i]/=10; 
         } 
    b[i]+=a[i]; 
    printf("%d\n",b[i]);
	}
    return 0;
}
int main(int argc, char* argv[])
{
    int x,y=0;
	scanf("%d",&x);	
	while(x>0){
		y=(y+x%10)*10;
		x=x/10;
	}
	y=y/10;
	printf("%d\n",y);
	return 0;
}
main()
{
  int n,a,b,c,d,e,f;
  scanf("%d",&n);
  if (n>=10000)
  {
  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=10000*e+1000*d+100*c+10*b+a;
  }
  else if (n>=1000)
  {
  a=n/1000;
  b=(n-1000*a)/100;
  c=(n-1000*a-100*b)/10;
  d=(n-1000*a-100*b-10*c)/1;
  f=1000*d+100*c+10*b+a;
  }
  else if (n>=100)
  {
  a=n/100;
  b=(n-100*a)/10;
  c=(n-100*a-10*b)/1;
  f=100*c+10*b+a;
  }
  else if (n>=10)
  {
  a=n/10;
  b=(n-10*a)/1;
  f=10*b+a;
  }
  else f=n;
  printf("%d",f);
}
void main()
{int i;
for (i=1;i<=4;i++)
{int yuan;
	scanf("%d\n",&yuan);
int a,b,c,d,e;
a=yuan%10;
b=((yuan-a)%100)/10;
c=((yuan-10*b-a)%1000)/100;
d=((yuan-100*c-10*b-a)%10000)/1000;
e=(yuan-1000*d-100*c-10*b-a)/10000;
int m;
if (e==0&&d==0&&c==0&&b==0) m=a;
else if(e==0&&d==0&&c==0) m=a*10+b;
     else if (e==0&&d==0) m=a*100+b*10+c;
          else if (e==0) m=a*1000+b*100+c*10+d;
               else   m=a*10000+b*1000+c*100+d*10+e;
printf ("%d\n",m);
}
}
int main()
{
	int a,b,g,s,h,q,w;
	scanf("%d",&a);
	if(a<10)
	{
		printf("%d",a);
	}
 if(a<=10&&a<100)
 {
		g=a/10;
	    s=a%10;
		b=10*s+g;
		printf("%d",b);
 }
	 if(a>=100&&a<1000)
	 {
		g=a/100;
	    a=a-100*g;
		s=a/10;
        h=a%10;
		b=100*h+10*s+g;
		printf("%d",b);
	 }
	 if(a>=1000&&a<10000)
	 {
		g=a/1000;
	    a=a-1000*g;
		s=a/100;
		a=a-100*s;
		h=a/10;
		q=a%10;
		b=1000*q+100*h+10*s+g;
		printf("%d",b);
	 }
	 if(a>=10000&&a<100000)
	 {
        g=a/10000;
	    a=a-10000*g;
		s=a/1000;
		a=a-1000*s;
		h=a/100;
		a=a-100*h;
		q=a/10;
		w=a%10;
		b=10000*w+1000*q+100*h+10*s+g;
		printf("%d",b);
	 }
return 0;
}
void main()
{int m,n,p=0;
scanf("%d",&n);
int i;
while(n!=0)
{printf("%d",n%10);
n=n/10;}
/*for(i=m;i<=n;i++)
{	if(i%7==0) 
	{if(p==1)
	{putchar(',');p--;}
	printf("%d",i);
	p++;}
}*/
}
int main()
{
	long b=0;
	long a[4][1];
	double t=0;
	int c[5];
	int i,j,f,k;
	for(i=0;i<4;i++)
	{
	   scanf("%ld",&a[i][0]);
	}
	for(i=0;i<4 && a[i][0]!=0;i++)
	{
		b=0;
	  for(k=0;k<5 && a[i][0]!=0;k++)
	  {
         c[k]=(a[i][0]%10);
		 a[i][0]=a[i][0]/10;
	  }
	  for(j=0;j<k;j++)
	  {
		 t=pow(10,(k-1-j));
		 f=(long)t;
		 b=b+f*c[j];
	  }
		printf("%ld\n",b);
	}
   	return 0;

}
int main(){
int a;
char zfc[6],exc[6];
scanf("%s",zfc);
a=strlen(zfc);
for(int i=0;i<a/2;i++){
exc[i]=zfc[i];
zfc[i]=zfc[a-i-1];
zfc[a-i-1]=exc[i];}
printf("%s\n",zfc);
return 0;
}
main()
{
	char a[5];
	scanf("%s",a);
	int l=strlen(a);
	char *p;
	
	p=(char*)malloc(l*sizeof(char));
		p=a;
	int i;
	for(i=1;i<=l/2;i++)
	{
		char b;
		b=*(p+i-1);
		*(p+i-1)=*(p+l-i);
		*(p+l-i)=b;
	}
	for(i=0;i<l;i++)
		printf("%c",*(p+i));
}
int main()
{
	int a,b,i,k,n,t;
	scanf("%d",&a);
	n=1;
	for(t=1;t<=a;t++)
	{k=a/10;
	if(k>0)
		n=n+1;}
	for(i=1;i<=n;i++)
	{
	b=a%10;
	a=a/10;
	if(b!=0)
	printf("%d",b);}
	return 0;
}
void main()
{
int b,c,n,i;
char a[5];
gets(a);
b=strlen(a);

for(i=b-1;i>=0;i--)
{
	printf("%c",a[i]);
}
getchar();


}
int main()
{
    char a[6];
    int i=0;
    do{
    a[i]=getchar();
    i++;
    }
    while(a[i-1]!='\n');
    i--;
    for(int j=i-1;j>=0;j--)
    cout<<a[j];
}
int main()
{
    int a,i=0,A,B,C,D,E;
   

	scanf("%d",&a);
	
		A=a/10000;
	B=(a-A*10000)/1000;
	C=(a-A*10000-B*1000)/100;
	D=(a-A*10000-B*1000-C*100)/10;
	E=(a-A*10000-B*1000-C*100-D*10)/1;
	if (a>9999)
	{i=A+B*10+C*100+D*1000+E*10000;}
	else if (a<10000&&a>999)
	{i=B*1+C*10+D*100+E*1000;}
		else if (a<1000&&a>99)
	{i=C*1+D*10+E*100;}
	printf("%d\n",i);
	return 0;
}
void main()
{
	int num,a,b,c,d,e;
	scanf("%d",&num);
	a=num/10000;
	b=num/1000-a*10;
	c=num/100-100*a-10*b;
	d=num/10-1000*a-100*b-10*c;
	e=num-a*10000-b*1000-c*100-d*10;
	if(a!=0)
		printf("%d%d%d%d%d",e,d,c,b,a);
	else if(b!=0)
		printf("%d%d%d%d",e,d,c,b);
	else if(c!=0)
		printf("%d%d%d",e,d,c);
	else if(d!=0)
		printf("%d%d",e,d);
	else if(e!=0)
		printf("%d",e);
	else 
		printf("0");
}
int main(int argc, char* argv[])
{
	int a,b,c,d,e,n;
	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){
		printf("%d\n",e*10000+d*1000+c*100+b*10+a);}
	else{ if(b>0)
		printf("%d\n",e*1000+d*100+c*10+b);
	else{if(c>0)
		printf("%d\n",e*100+d*10+c);
		else{if(b>0)
		printf("%d\n",e*10+d);
		else
		printf("%d\n",e);}}
	}
	return 0;
}
int main()
{
	int n,a,b,c,d,e;
	cin>>n;
	a=n/10000;
	b=(n-10000*a)/1000;
	c=(n-a*10000-b*1000)/100;
	d=(n%100)/10;
	e=n%10;
	if(a!=0)
		cout<<e<<d<<c<<b<<a<<endl;
	else
		if(b!=0)
			cout<<e<<d<<c<<b<<endl;
		else
			if(c!=0)
				cout<<e<<d<<c<<endl;
			else
				if(d!=0)
					cout<<e<<d<<endl;
				else
					cout<<e<<endl;
	return 0;
}
void main()
{
	unsigned int a,b,c,d,e,x;	
	scanf("%d",&x);
	a=x/10000;b=x/1000-x/10000*10;c=x/100-x/1000*10;d=x/10-x/100*10;e=x%10;
	if(a!=0)printf("%d\n",a+10*b+100*c+1000*d+10000*e);
	else if(b!=0)printf("%d\n",b+10*c+100*d+1000*e);
	else if(c!=0)printf("%d\n",c+10*d+100*e);
	else if(d!=0)printf("%d\n",d+10*e);
	else if(e!=0)printf("%d\n",e);
}
void main()
{
	int a[5],m,i,k=0;
	scanf("%d",&m);
	for(i=0;i<5;i++)
	{
		a[i]=m%10;
	    m=m/10;
	}
	for(i=0;i<5;i++)
	{
		if(a[i]!=0)
			k++;
	}
    a[i]=a[k-1-i];

	i=0;
	do
	{
	if(a[i]!=0)
		printf("%d",a[i]);
	i++;
	}
    while(i<5);

	
	
}
int main(int argc, char* argv[])
{ 
	int a,b;
	int x,y,z,o,p;;
    int len;
	scanf("%d",&a);
	len=0;
	b=a;
while(b>0)
{
		b=b/10;
		len++;
	}
		if(len==1)
		{
			printf("%d%",a);
		}

		else if(len==2)
		{
			x=a/10;
		y=a-10*x;
		printf("%d",10*y+x);
		}
		else if(len==3)
		{
			x=a/100;
			y=(a-x*100)/10;
			z=a-100*x-10*y;
			printf("%d",z*100+y*10+x);
		}
		else if(len==4)
		{
			x=a/1000;
		y=(a-x*1000)/100;
		z=(a-x*1000-y*100)/10;
		o=a-x*1000-y*100-z*10;
		printf("%d",o*1000+z*100+y*10+x);
		}
		else if(len==5)
		{
			x=a/10000;
			y=(a-x*10000)/1000;
			z=(a-x*10000-y*1000)/100;
			o=(a-x*10000-y*1000-z*100)/10;
			p=a-x*10000-y*1000-z*100-o*10;
			printf("%d",p*10000+o*1000+z*100+y*10+x);
		}

return 0;
}
void main()
{
 int n;
 int r( int m );
scanf("%d",&n);
r(n);
} 

r( int m )
{ printf("%d",m%10);
m =m/10;
if( m!=0)
return r(m);
}