semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
	int n=0;
	int n_1=0,i=0;
	int len=0;
	int a[6]={0};
	scanf("%d",&n);
	n_1=n;
	for(;n/10>0;)
	{
		n=n/10;
		len++;
	}
	len++;
	for(i=0;i<len;i++)
	{
		a[i]=n_1%10;
		n_1=n_1/10;
	}
	for(i=0;i<len;i++)
	{
		printf("%d",a[i]);
	}
}
int main()
{
   int n,a1,a2,a3,a4;
   scanf("%d",&n);
   a1=n/1000;
   a2=(n-1000*a1)/100;
   a3=(n-1000*a1-100*a2)/10;
   a4=(n-1000*a1-100*a2-10*a3);
    if(a1==0&a2==0&a3==0)
   printf("%d",a4);
   if(a1==0&a2!=0)
    printf("%d%d%d",a4,a3,a2);
   if(a1!=0&a2!=0&a3!=0)
    printf("%d%d%d%d",a4,a3,a2,a1);


    return 0;
}
int main()
{
	int a,g,s,b,q,o=0,p=1;
	scanf("%d",&a);
	if(a==10000)
		printf("%d%d%d%d%d\n",o,o,o,o,p);
	{
		if(a<=10)
			printf("%d\n",a);
		else if(a<100)
		{
			s=(a%100)/10;
			g=a%10;
			printf("%d%d\n",g,s);
		}
		else if(a<1000)
		{
			b=(a%1000)/100;
			s=(a%100)/10;
			g=a%10;
			printf("%d%d%d\n",g,s,b);
		}
		else if(a<10000)
		{
			q=(a%10000)/1000;
			b=(a%1000)/100;
			s=(a%100)/10;
			g=a%10;
			printf("%d%d%d%d\n",g,s,b,q);
		}
	}
	return 0;
}
int main()
{int n,weishu;
 int ge,shi,bai,qian;
 scanf("%d",&n);
 if ((0<=n)&&(n<=9)) 
   printf("%d\n",n); 
 if ((10<=n)&&(n<=99))
 { ge=n%10;
   shi=n/10;
   printf("%d%d",ge,shi);
 }
 if ((100<=n)&&(n<=999)) 
 {  ge=n%10;
    shi=((n-ge)/10)%10;
	bai=n/100;
	printf("%d%d%d",ge,shi,bai);
 }
  if ((1000<=n)&&(n<=9999))
  {ge=n%10;
  shi=((n-ge)/10)%10;
  bai=((n-shi*10)/100)%10;
  qian=(n-bai*100)/1000;
  printf("%d%d%d%d",ge,shi,bai,qian);
  }

}
int main()
{
	int a,b,c,d,e,f,g,h,i,j,k;
    scanf("%d",&a);
    b=a/10000;
    c=a/1000;
    d=a/100;
    e=a/10;
    f=a%10;
    g=e%10;
    h=d%10;
    i=(a/10)%10;
    j=(a/100)%10;
    k=(a/1000)%10;
    if(b==0)
	{
		if(c==0)
        {
			if(d==0)
            {
				if(e==0)
                {
					printf("%d",f);
                }
                else
                printf("%d%d",f,e);
            }
            else
            printf("%d%d%d",f,g,d);
        }
        else
			printf("%d%d%d%d",f,i,h,c);
    }
    else
    printf("%d%d%d%d%d",f,i,j,k,b);
    return 0;
}
int main()
{
	int n,q1,q2,q3,q4,q5,r1,r2,r3,r4,r5;
	scanf("%d",&n);
	q1=n/10;
	r1=n%10;

	if(q1==0)
		printf("%d\n",r1);
	else
	{
		q2=q1/10;
		r2=q1%10;

		if(q2==0)
			printf("%d%d\n",r1,r2);
		else
		{
			q3=q2/10;
			r3=q2%10;

			if(q3==0)
				printf("%d%d%d\n",r1,r2,r3);
			else
			{
				q4=q3/10;
				r4=q3%10;

				if(q4==0)
					printf("%d%d%d%d\n",r1,r2,r3,r4);
				else
				{
					q5=q4/10;
					r5=q4%10;
					printf("%d%d%d%d%d\n",r1,r2,r3,r4,r5);
				}

			}
		}
	}

	return 0;
}
int main()
{
	long a;
	int b,c,d,e,f,g;
	scanf("%d",&a);
	if(0<=a&&a<=9)
		b=1;
	else {if(10<=a&&a<=99)
		b=2;
else {if(100<=a&&a<=999)
		b=3;
	else {if(1000<=a&&a<=9999)
		b=4;
else {if(10000<=a&&a<=99999)
		b=5;}}}}
switch(b)
	{case 1:{printf("%d\n",a);}break;
	case 2:{c=a/10;
		 d=a%10;
			printf("%d%d\n",d,c);}break;
case 3:{c=a/100;
		 d=(a-c*100)/10;
			e=a-c*100-d*10;
			printf("%d%d%d\n",e,d,c);}break;
case 4:{c=a/1000;
		 d=(a-c*1000)/100;
			e=(a-c*1000-d*100)/10;
			f=a-c*1000-d*100-e*10;
			printf("%d%d%d%d\n",f,e,d,c);}break;
case 5:{c=a/10000;
		 d=(a-c*10000)/1000;
			e=(a-c*10000-d*1000)/100;
			f=(a-c*10000-d*1000-e*100)/10;
			g=a-c*10000-d*1000-e*100-f*10;
			printf("%d%d%d%d%d\n",g,f,e,d,c);}}
			return 0;
}
//??????
int main()
{
	int n,a[10000],i=0,d[10000];
	cin>>n;
	float b[10000],c;
	c=n/10;
	b[0]=floor(c);
	a[0]=n%10;
	if(b[0]==0)
		cout<<n<<endl;
	if(b[0]!=0)
	{
	while(1)
	{
		a[i+1]=(int)b[i]%10;
		b[i+1]=floor(b[i]/10);
		if(b[i+1]<1)
			break;
		i++;
	}
	for(int k=0;k<=i+1;k++)
	{
		cout<<a[k];
	}
	cout<<endl;
	}
	return 0;
}
int main()
{
	int a,b,c,d,e,f;
	scanf("%d",&a);
		if(a<10000)
	      if(a<1000)
			if(a<100)
				if(a<10) b=0,c=0,d=0,e=0,f=a;
				else b=0,c=0,d=0,e=a/10,f=a-10*e;
			else b=0,c=0,d=a/100,e=(a-d*100)/10,f=a-d*100-e*10;
		else b=0,c=a/1000,d=(a-c*1000)/100,e=(a-c*1000-d*100)/10,f=a-c*1000-d*100-e*10;
	else 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(a<10000)
	   if(a<1000)
	      if(a<100)
			if(a<10) printf("%d\n",a);
			else printf("%d%d\n",f,e);
		  else printf("%d%d%d\n",f,e,d);
		else printf("%d%d%d%d\n",f,e,d,c);
	else printf("%d%d%d%d%d\n",f,e,d,c,b);
	return 0;
}
int main()
{
	int f;
	scanf("%d",&f);
	if(f==10000)
	{printf("00001\n");}
	else if(f>999&&f<=9999)
	{int a,b,c,d;
	a=1;
	while(f-a*1000>=0)
	{a++;}
	a=a-1;b=1;
	while(f-a*1000-b*100>=0)
	{b++;}
		c=1;b=b-1;
	while(f-a*1000-b*100-c*10>=0)
	{c++;}
		d=1;c=c-1;
	while(f-a*1000-b*100-c*10-d*1>=0)
	{d++;}d=d-1;
	printf("%d%d%d%d",d,c,b,a);}
    else if (f>99&&f<=999)
		{int a,b,c;
	a=1;
	while(f-a*100>=0)
	{a++;}
	a=a-1;b=1;
	while(f-a*100-b*10>=0)
	{b++;}
		c=1;b=b-1;
	while(f-a*100-b*10-c*1>=0)
	{c++;}
		c=c-1;
		printf("%d%d%d",c,b,a);}
	else if (f>9&&f<=99)
		{int a,b;
	a=1;
	while(f-a*10>=0)
	{a++;}
	a=a-1;b=1;
	while(f-a*10-b*1>=0)
	{b++;}
		b=b-1;
		printf("%d%d",b,a);}
	else 
	{printf("%d",f);}
	return 0;
}
int main()
{
	int i,num,k,a[6];

	cin>>num;
    if(num==0) cout<<num;	
	for(i=5;i>=0;i--)
	{
		a[5-i]=num/(pow((float)10,i));
		num=num-a[5-i]*pow((float)10,i);
	
	}

	for(i=0;i<6;i++)
	{

	if(a[i]!=0) break;
	
	
	}

	for(k=5;k>=i;k--)
	{
	
	cout<<a[k];
	
	}

	return 0;
}
int main()
{
	int n,a,b,c,d,e;
	scanf("%d",&n);
	a=n%10;
	b=(n-a)%100/10;
	c=(n-(n%100))%1000/100;
	d=(n-(n%1000))%10000/1000;
	e=1;
	if (n<10)
	{printf("%d",n);}
	else
	{if (n<100)
	{printf("%d%d",a,b);}
	else
	{if (n<1000)
	{printf("%d%d%d",a,b,c);}
	else
	{if (n<10000)
	{printf("%d%d%d%d",a,b,c,d);}
	else
	{printf("abcde");}}}}
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	if(n>=1000&&n<10000)
	{
		a=n/1000;
		b=(n-a*1000)/100;
		c=(n-a*1000-b*100)/10;
		d=n-a*1000-b*100-c*10;
		printf("%d%d%d%d\n",d,c,b,a);
	}
	else
	{
		if(n>=100&&n<1000)
		{
			a=n/100;
			b=(n-a*100)/10;
			c=n-a*100-b*10;
			printf("%d%d%d\n",c,b,a);
		}
		else
		{
			if(n>=10&&n<100)
			{
				a=n/10;
				b=n-a*10;
				printf("%d%d\n",b,a);
			}
			else
			{
				if(n<10)
				{
					printf("%d\n",n);
				}
				else
				{
					printf("00001\n");
				}
			}
		}
	}
		return 0;
}
main()
{
int x,a,b,c,d,e,n;
scanf("%d",&x);
if(x>9999)
 n=5;
else
{
if(x>999)
n=4;
   else
   { 
     if(x>99)
     n=3;
     else
	 {
       if(x>9)
       n=2;
       else
       n=1;
	 }
   }
}		
switch(n)
{
case 5:
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);
printf("%d%d%d%d%d\n",e,d,c,b,a);
break;
case 4:
b=x/1000;
c=(x-b*1000)/100;
d=(x-b*1000-c*100)/10;
e=(x-b*1000-c*100-d*10);
printf("%d%d%d%d\n",e,d,c,b);
break;
case 3:
c=x/100;
d=(x-c*100)/10;
e=(x-c*100-d*10);
printf("%d%d%d\n",e,d,c);
break;
case 2:
d=x/10;
e=(x-d*10);
printf("%d%d\n",e,d);
break;
case 1:
printf("%d\n",x);
}
return 0;




}
int main()
{int a,b,c,d,n;
 cin>>n;
 if(n/10<1)
	 cout<<n<<endl;
  else{d=n%10;
       n=n/10;
       if(n/10<1)
	   cout<<d<<n<<endl;
       else{c=n%10;
            n=n/10;
            if(n/10<1)
	        cout<<d<<c<<n<<endl;
            else{b=n%10;
                 n=n/10;
                 if(n/10<1)
	             cout<<d<<c<<b<<n<<endl;
                 else{a=n%10;
                      n=n/10;
                      if(n/10<1)
	                  cout<<d<<c<<b<<a<<n<<endl;
				 }}}}
  return 0;
}
void main ()
{
int a,c,d,e,f,g;
scanf("%d",&a);
if(a==10000)
printf("00001");
else if(a>=1000&&a<=9999)
{
c=a/1000;
d=(a-1000*c)/100;
e=(a-1000*c-d*100)/10;
f=a-1000*c-d*100-e*10;
g=f*1000+e*100+d*10+c;
printf("%d%d%d%d",f,e,d,c);
}
else if (a>=100&&a<=999)
{c=0;
d=(a-1000*c)/100;
e=(a-1000*c-d*100)/10;
f=a-1000*c-d*100-e*10;
g=f*100+e*10+d*1+c;
printf("%d%d%d",f,e,d);
}
else if (a>=10&&a<=99)
{c=0;
d=0;
e=(a-1000*c-d*100)/10;
f=a-1000*c-d*100-e*10;
g=f*10+e;
printf("%d%d",f,e);}
else 
{g=a;
printf("%d",g);}

}
int main()
{
	int a,i=0;
    scanf("%d",&a);
if(a==100)
printf("001");
else
{
	while(a>0)
	{
		i=i*10+a%10;
		//printf("%d",i);
		a=a/10;
	}
     printf("%d",i);}
	return(0);		
}
int main(){
    int n,m,i;
    cin>>n;
    m=(int)(log10(n)+1);
    if(n==0)
    cout<<0;
    else{
    for(i=1;i<=m;i++){
      cout<<n%10;
      n=(n-n%10)/10;
                      }
                      }
      return 0;
}
int main()
{int n,a,b,c,d,e,f,g,h,i;
scanf("%d",&n);
if(n<10)
printf("%d",n);
else if(n<100)
{a=n%10;b=n/10;
printf("%d%d",a,b);}
else if(n<1000)
{c=n%10,e=n/100;d=(n/10)%10;
printf("%d%d%d",c,d,e);}
else if(n<10000)
{f=n%10;g=(n%100)/10;h=(n/100)%10;i=n/1000;
printf("%d%d%d%d",f,g,h,i);}
return 0;
}
int main()
{
    int n,a[5];
    scanf("%d",&n);
    a[0]=n/10000;
    a[1]=n/1000-10*a[0];
    a[2]=n/100-100*a[0]-10*a[1];
    a[4]=n%10;
    a[3]=(n%100-n%10)/10;
printf("\n");
    if(n!=0){for(int i=0;i<5;i++)
       if (a[i]==0) continue;
       else {for (int j=4;j>=i;j--) printf("%d",a[j]);break;}}
else printf("0");
    }
int main(int argc, char *argv[])
{
  int num,b1,b2,b3,b4,b5;
  scanf("%d",&num); 
  b1=num/10000;
  b2=(num-10000*b1)/1000;
  b3=(num-10000*b1-1000*b2)/100;
  b4=(num-10000*b1-1000*b2-100*b3)/10;
  b5=(num-10000*b1-1000*b2-100*b3-10*b4);
  if (b1!=0)
     printf("%d%d%d%d%d",b5,b4,b3,b2,b1);
  else if (b2!=0)
     printf("%d%d%d%d",b5,b4,b3,b2);
  else if (b3!=0)
     printf("%d%d%d",b5,b4,b3);
  else if (b4!=0)
     printf("%d%d",b5,b4);
  else
     printf("%d",b5);
  return 0;
}
int main()
{
    int a,b,c,d,e,f,g,h,i,j;
    scanf("%d",&a);
    if(a<=9) printf("%d\n",a);  
    else
    {if(a<=99) 
    {b=a/10;c=a-10*b;
    printf("%d%d",c,b);}
    else
    {if(a<=999)
    {d=a/100;e=(a-d*100)/10;f=a-100*d-10*e;
    printf("%d%d%d",f,e,d);}
    else
    if(a<=9999)
    {g=a/1000;h=(a-1000*g)/100;i=(a-1000*g-100*h)/10;j=a-1000*g-100*h-10*i;
    printf("%d%d%d%d",j,i,h,g);}
    else
    if(a=10000)
    printf("00001\n");}}	
  return 0;
}
int main()
{
	int n ;
	int a, b, c, d, e;
	cin >> n;
	int x;
	x = n;
	a = n / 10000;
	n = n - a * 10000;
	b = n / 1000;
	n = n - b * 1000;
	c = n / 100;
	n = n - c * 100;
	d = n / 10;
	e = n - d * 10;
	if (x < 10)
		cout << e << endl;
	else if (( x >= 10) && (x < 100))
		cout << e << d << endl;
	else if ((x >= 100) && (x < 1000))
		cout << e << d << c << endl;
	else if ((x >= 1000) && (x < 10000))
		cout << e << d << c << b << endl;
	else 
		cout << "00001"<< endl;
	return 0;
}
int main()
//
{int n,a,b,c,d;
scanf("%d",&n);
if((n>=0)&&(n<=9)) printf("%d",n);
   else if((n>=10)&&(n<=99))
   {a=n%10;
    b=(n-(n%10))/10;
	printf("%d%d",a,b);}
    else if((n>=100)&&(n<=999))
   {a=n%10;
    b=((n-a)%100)/10;
	c=(n-a-10*b)/100;
	printf("%d%d%d",a,b,c);}
    else if((n>=1000)&&(n<=9999))
   {a=n%10;                    //??n????
    b=((n-a)/10)%10;           //??n????
	c=((n-a-10*b)/100)%10;     //??n????
	d=(n-a-10*b-100*c)/1000;   //??n????
	printf("%d%d%d%d",a,b,c,d);}//?n????
else printf("00001");
return 0;
}
int main()
{
	int n;
	cin >> n;
	if (n == 0)
		cout << n;
	else
		while(n > 0)
		{
			cout << n % 10;
			n = n / 10;
		}
	cout << endl;
	return 0;
}
int main()
{
	int a,b,c,d,f;
	scanf("%d",&a);
	if(a/10==0)
	{
		printf("%d",a);
	}
	else if(a/100==0)
	{
		b=a/10;
	c=a%10;
	printf("%d%d",c,b);
	}
		else if(a/1000==0)
		{
		b=a/100;
	c=(a-b*100)/10;
		d=a%10;
	printf("%d%d%d",d,c,b);
		}
	else if(a/10000==0)
	{
		b=a/1000;
	c=(a-b*1000)/100;
	d=(a-b*1000-c*100)/10;
	f=a%10;
	printf("%d%d%d%d",f,d,c,b);
	}
	return 0;
}
int main()
{
	
	int n,a[10];

	int i;
while(cin>>n)
{
if(n==0)
{
 cout<<0;
}
for(i=1;i<=5 && n!=0;i++)
{
	a[i]=n%10;
	n=n/10;
	cout<<a[i];
}
cout<<endl;
}
      


	return 0;
}
int main()
{
    int n,a,b,c,d;
    scanf("%d",&n);
    if(n/10000==1)
    printf("00001");
    else if(n/1000!=0)
    { a=n;
      b=a%10;
      a=a/10;
      c=a%10;
      a=a/10;
      d=a%10;
      a=a/10;
      printf("%d%d%d%d",b,c,d,a);
    }
    else if(n/100!=0)
    {
     a=n;
      b=a%10;
      a=a/10;
      c=a%10;
      a=a/10;
      printf("%d%d%d",b,c,a);
      }
      else if(n/10!=0)
       {
       a=n;
       b=a%10;
       a=a/10;
       printf("%d%d",b,a);
       }
       else printf("%d",n);
       return 0;
}
int main()
{
    int n;
    int i=0;
    int num[5];
    scanf("%d",&n);
    while( n/10!=0 )
    {
           num[i++]=n%10;
           n/=10;       
    }
    num[i]=n;
    for( int m=0;m<=i;m++ )
    printf("%d",num[m]);
printf("\n");
}
int main()
{
	char a[10001],b[10001],c[10001];
	int x,i;
	cin>>a;
	x=strlen(a);
    for(i=0;i<=x;i++)
		b[i]=a[x-i-1];
	
	cout<<b;
	return 0;
}
main()
{
 int a,b,c,d,e,f;
 scanf("%d",&a);
 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%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);
}
int main()
{
  int a;
  scanf("%d",&a);
  if(a==0) printf("0");
  while (a!=0)
  {
    printf("%d",a-(a/10)*10);
    a=a/10; 
  } 
}
void main()
{
	int i,j;
	char a[6];
	for(i=0;i<6;i++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n')
			break;
	}
	for(j=i-1;j>-1;j--)
		printf("%c",a[j]);
}
int main(int argc, char* argv[])
{

	int a,c,d;
	scanf("%d",&a);
	c=a;
	while(c>=1)
	{
	d=c-(c/10)*10;
	c=c/10;
	printf("%d",d);
	
	}
	if (a==0)
	printf("0");
	return 0;
}
void main()
{
	int x,a,b,c,d,e,m,n,o,p;
	scanf("%d",&x);
	m=x/10000;
	n=x/1000;
	o=x/100;
	p=x/10;
		if(m!=0)
		{
		a=m;
		b=n-10*a;
		c=o-100*a-10*b;
		d=p-1000*a-100*b-10*c;
		e=x%10;
		printf("%d%d%d%d%d",e,d,c,b,a);
		}
	else 
		if(n!=0)
		{
			a=n;
			b=o-10*a;
			c=p-100*a-10*b;
			d=x%10;
			printf("%d%d%d%d",d,c,b,a);
		}
		else if(o!=0)
		{	
				a=o;
				b=p-10*o;
				c=x%10;
				printf("%d%d%d",c,b,a);
		}
			else if(p!=0)
			{
					a=p;
					b=x%10;
					printf("%d%d",b,a);
			}
			else {
			printf("%d",x);}
}
int main()
{   int a,b,c,d,e,f;
    scanf("%d",&a);
	b=a/10000;
	c=a/1000;
	d=(a%1000)/100;
	e=(a%100)/10;
	f=a%10;
	if(b!=0) printf("%05d",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;
}
void main()
{
	long a;
	int b,c,d,e,f;
	scanf("%ld",&a);
    f=a%10;
	a=(int)(a/10);
	e=a%10;
	a=(int)(a/10);
    d=a%10;
	a=(int)(a/10);
    c=a%10;
	a=(int)(a/10);
    b=a%10;
	if(b!=0)
		printf("%d%d%d%d%d\n",f,e,d,c,b);
	else
		if(c!=0)
	     	printf("%d%d%d%d\n",f,e,d,c);
		else
			if(d!=0)
				printf("%d%d%d\n",f,e,d);
			else
				if(e!=0)
                    printf("%d%d\n",f,e);
				else
					printf("%d\n",f,f);
}
int main()
{
int a,b,c,d,e;
scanf("%d",&a);
if(a<10)printf("%d",a);
else if (a<100)
{b=(int)a/10;
c=a-b*10;
printf("%d%d",c,b);}
else if(a<1000)
{b=(int)a/100;c=(int)(a-100*b)/10;d=a-100*b-10*c;printf("%d%d%d",d,c,b);}
else if(a<10000)
{b=(int)a/1000;c=(int)(a-1000*b)/100;d=(int)(a-1000*b-100*c)/10;
e=a-1000*b-100*c-10*d;printf("%d%d%d%d",e,d,c,b);}
else if(a==10000)printf("00001");
}
//??????
//2010?11?26?
//1000012753 ???
int main()
{
	char str1[100], str2[100];
	int i, j, l;
	cin >> str1;
	l = strlen(str1);
	j = 0;
	for (i = l - 1; i >= 0; --i)
		str2[j++] = str1[i];
	str2[j] = '\0';
	cout << str2 << endl;
	return 0;
}
int main()
{
int n,a,b,c,d;
a=b=c=d=0;
cin>>n;
while(n>999){
	n=n-1000;
	a=a+1;}
while(n>99){
	n=n-100;
	b++;}
while(n>9){
	n=n-10;
	c++;}
if(n>0){
while(n>0){
	n=n-1;
	d++;}}
else if(n=0)
	d=0;
if(a==0){
	if(b==0){
		if(c==0){
			if(d==0){
				cout<<d;}
			else 
				cout<<d;}
		else
			cout<<d<<c;}
	else
		cout<<d<<c<<b;}
else cout<<d<<c<<b<<a;
	return 0;
}
int main()
{
int n,i,j,f,a,m;

scanf("%d",&n);
for(i=5;i>=1;i--)
{
f=pow(10,i);
a=n/f;
if(a!=0) break;
}
for(j=1;j<=i+1;j++)
{
m=n%10;



printf("%d",m);
n=(n-m)/10;

}
return 0;

}
// 0001.cpp : Defines the entry point for the console application.
//

int main()
{
    int n,i,k,s;
	scanf("%d",&n);
	i=n;
	s=0;
	while(i>0)
	{
        k=i%10;
		if(k==0) printf("0"),i/=10;
		else
		{
		   i=i/10;
		   s=s*10+k;
        }
    }
	printf("%d\n",s);
	return 0;
}
void f(int n)
{
	cout<<n%10;
	n=n/10;
	if(n)	f(n);
}


int main(){
	int n;
	cin>>n;
	f(n);
	return 0;
}
int main()
{
	int a,b;
	scanf("%d",&a);
	if(a==0) printf("0");
	else
	{
	while(a!=0)
	{
		b=a-a/10*10;
		a=a/10;
		printf("%d",b);
	}
	}
	return 0;
}
void main()
{
 int x,a,b,c,d,e;
 scanf("%d",&x);
 a=x%10;
 b=(x%100-a)/10;
 c=(x%1000-b*10-a)/100;
 d=(x%10000-c*100-b*10-a)/1000;
 e=(x%100000-d*1000-c*100-b*10-a)/10000;
 if(e!=0) printf("%d%d%d%d%d",a,b,c,d,e);
 if((e==0) && (d!=0)) printf("%d%d%d%d",a,b,c,d);
 if((e==0) && (d==0) && (c!=0)) printf("%d%d%d",a,b,c);
 if((e==0) && (d==0) && (c==0) && (b!=0)) printf("%d%d",a,b);
 if((e==0) && (d==0) && (c==0) && (b==0)) printf("%d",a);
 
}
int main()
{ 
 int a,b,c,d,e,f,g;
 scanf("%d",&a);
b=a/10000;
c=(a-b*10000)/1000;
d=a/100-(a/1000)*10;
e=a/10-(a/100)*10;
f=a-(a/10)*10;
if(b!=0)
{g=f*10000+e*1000+d*100+c*10+b;
printf("%05d",g);}
else 
if(c!=0)
{g=f*1000+e*100+d*10+c;
printf("%04d",g);}
else
if(d!=0)
{g=f*100+e*10+d;
printf("%03d",g);}
else
if(e!=0)
{g=f*10+e;
printf("%01d",g);}
else
{g=f;
printf("%d",g);}
return 0;
}
int main()
{
	int a,b,c,d,e,f,i;
	scanf("%d",&a);
	i=1+log10(a);
	b=a/10000;
	a=a%10000;
	c=a/1000;
	a=a%1000;
	d=a/100;
	a=a%100;
	e=a/10;
	a=a%10;
	f=a;
	printf("%d",f);
	if(i>1)printf("%d",e);
	if(i>2)printf("%d",d);
	if(i>3)printf("%d",c);
	if(i>4)printf("%d",b);
	return 0;
}
int main ( )
{
	int i, j, n, t, m;
	char a[1][5];                    /*????????*/
	cin.get(a[0],5);                 /*???????*/
	n = strlen(a[0]);
	for (i = 0,j = n-1;i < j;i++,j--)/*?????????*/
	{
		t = a[0][i];
		a[0][i] = a[0][j];
		a[0][j] = t;
	}
	for (m = 0;m < n;m++)            /*????????????*/
		cout <<a[0][m];
	return 0;
}
int main()
{
	int t,a,b,c,d,e;
	scanf("%d",&t);
	a=t/10000;
	b=(t-a*10000)/1000;
	c=(t-a*10000-b*1000)/100;
	d=(t-a*10000-b*1000-c*100)/10;
	e=t-a*10000-b*1000-c*100-d*10;
	if(a==0&&b==0&&c==0&&d==0) printf("%d",e);
	else {
		if(a==0&&b==0&&c==0&&d!=0) printf("%d%d",e,d);
		else{
			if(a==0&&b==0&&c!=0) printf("%d%d%d",e,d,c);
	           else{
				   if(a==0&&b!=0) printf("%d%d%d%d",e,d,c,b);
                    	else
						{
		                   if(a!=0) printf("%d%d%d%d%d",e,d,c,b,a);
						}
			   }
		}
		}
	return 0;
}
int main(){
	int len;
	char str[6];
	
	cin >> str;
	len = strlen(str);
	for (int i = len - 1; i >= 0; i--)
		cout << str[i];
	
	return 0;
}
void main()
{
	int n,a,b,c,d,e;
	scanf("%d",&n);
	a=n%10;
	b=(n%100-n%10)/10;
	c=(n%1000-n%100)/100;
	d=(n%10000-n%1000)/1000;
	e=(n-1000*d-100*c-10*b-a)/10000;
	if(e!=0)
	{	
	    printf("%d%d%d%d%d",a,b,c,d,e);
	}
	else
		if(d!=0)
        {
			printf("%d%d%d%d",a,b,c,d);
		}
		else 
			if(c!=0)
            {
				printf("%d%d%d",a,b,c);
            }
			else
				if(d!=0)
				{
					printf("%d%d",a,b);
				}
				else
				{
					printf("%d",a);
				}
	                
}
int main()
{
    int n,a,b,c,d,e;
    cin>>n;
    a=n%10;
	n=(n-a)/10;
	b=n%10;
	n=(n-b)/10;
    c=n%10;
	n=(n-c)/10;
    d=n%10;
	n=(n-d)/10;
    e=n%10;
	n=(n-e)/10;
	if(e!=0)
		cout<<a<<b<<c<<d<<e<<endl;
	else
		if(d!=0)
			cout<<a<<b<<c<<d<<endl;
		else
			if(c!=0)
				cout<<a<<b<<c<<endl;
			else
				if(b!=0)
					cout<<a<<b<<endl;
				else
					cout<<a<<endl;
    return (0);
}
int main()
{
	int a,b,c,d,e,f,g;
	scanf("%d",&a);
	if(a<=9) printf("%d",a);
	else if(a>=10&&a<=99) 
		{
			b=a%10;
			c=(a-b)/10;
			printf("%d%d",b,c);
	}
	else if(a>=100&&a<=999)
	{
		b=a%10;
		c=((a-b)/10)%10;
		d=(a-b-10*c)/100;
		printf("%d%d%d",b,c,d);
	}
	else if(a>=1000&&a<=9999)
	{
		b=a%10;
		c=((a-b)/10)%10;
		d=((a-b-10*c)/100)%10;
		e=(a-b-10*c-100*d)/1000;
		printf("%d%d%d%d",b,c,d,e);
	}
	else if(a>=10000&&a<=99999) 
	{
		b=a%10;
		c=((a-b)/10)%10;
		d=((a-b-10*c)/100)%10;
		e=((a-b-10*c-100*d)/1000)%10;
		f=(a-b-10*c-100*d-1000*e)/10000;
		printf("%d%d%d%d%d",b,c,d,e,f);
	}
	return 0;
}
int main()
{
    int p,m,n,a[10];
    cin>>n;
    m=n;
    p=1;
    while(m/10!=0)
    {
        a[p-1]=m%10;
        m=m/10;
        p++;
        }
        a[p-1]=m;
        for(int j=0;j<p;j++)
        cout<<a[j];
        return 0;

    }
int main()
{
	int a,b,c,d,n;
	scanf("%d",&n);
while (n>0) {
   printf("%d",n%10);
   n=n/10;
}

}
int main()
{
	int a,b,c,d,f;
	scanf("%d",&a);
	if(a<10&&a>=0)printf("%d",a);
	 else if(a>=10&&a<100)
	 {
		 b=a%10;
	    c=(a-b)/10;
		printf("%.2d",b*10+c);
	}
	 else if(a>99&&a<1000)
	 {
		 b=a%10;
	  c=((a-b)/10)%10; 
	  d=((a-b-c*10)/100)%10;
	  printf("%.3d",b*100+c*10+d);
	 }
	 else	if(a>999&&a<10001)
	 {
		 b=a%10;
	  c=((a-b)/10)%10; 
	  d=((a-b-c*10)/100)%10;
	  f=((a-b-c*10-d*100)/1000)%10;
		  printf("%.4d",b*1000+c*100+d*10+f);
	 }
	 else
	  return 0;
}
int main()
{
	int n;
	cin>>n;
	int a[100]={0};
    int i=0,b=n,j;
	do
	{
		b=b/10;
		i++;
	}
	while (b!=0);
	for(j=0;j<i;j++)
	{
		a[j]=n%10;
		n = n /10;
	}
	for(i=0;i<j;i++)
		cout<<a[i];
	return 0;
}
main()
{
    int n;
    scanf("%d",&n);
    int m=0;
    int nn=n;
    for(int i=1;i<5;i++)
    {
       n=n/10;
       if(n==0) 
       {
         m=i;
         break;
       }     
    }
    int a;
    for(int i=0;i<m;i++)
    {
       a=nn%10;
       printf("%d",a);   
       nn=nn/10;       
    }
    getchar();
    getchar();
}
struct integ
{
	char num;
	struct integ *next;
}*head,*p1,*p2,*p3,*newhead;
void main()
{
	int i,n=0;
	p1=p2=(struct integ *)malloc(sizeof(struct integ));
	head=NULL;		
	for(i=0;;i++)
	{
		scanf("%c",&p1->num);
		if(p1->num<48||p1->num>57)break;
		n++;
		if(n==1)head=p1;
		else p2->next=p1;
		p2=p1;p1=(struct integ *)malloc(sizeof(struct integ));
	}p2->next=NULL;
	for(i=0;i<n;i++)
	{
		p1=head;
		while(p1->next!=NULL)
		{p2=p1;p1=p1->next;}
		if(i==0){p3=newhead=p1;}
		else p3=p3->next=p1;
		p2->next=NULL;	
	}
	for(p1=newhead;p1!=NULL;p1=p1->next)
		printf("%c",p1->num);
}
int main()
{
	int b,a[5],j;
	scanf("%d",&b);
	a[4]=b/10000;
	a[3]=(b-a[4]*10000)/1000;
	a[2]=(b-a[4]*10000-a[3]*1000)/100;
	a[1]=(b-a[4]*10000-a[3]*1000-a[2]*100)/10;
	a[0]=b-a[4]*10000-a[3]*1000-a[2]*100-a[1]*10;
	if (b>=10000)
			for (j=0;j<=4;j++)
				printf("%d",a[j]);
	else if (b>=1000)
			for (j=0;j<=3;j++)
				printf("%d",a[j]);
	else if (b>=100)
			for (j=0;j<=2;j++)
				printf("%d",a[j]);
	else if (b>=10)
			for (j=0;j<=1;j++)
				printf("%d",a[j]);
	else
				printf("%d",a[0]);

}
int main(){
	int a;
	scanf("%d", &a);
	if (a<10) {
		printf("%d\n", a);
	} else if (a<100) {
		int b,c;
		b=a%10;
		c=(a-b)/10;
		printf("%02d\n", 10*b+c);
	} else if (a<1000) {
		int d, e,f;
		d=a%10;
		e=a%100;
		e=(e-d)/10;
		f=(a-d-10*e)/100;
		printf("%03d\n", 100*d+10*e+f);
	} else if (a<10000) {
		int g, h, i, j;
		g=a%10;
		h=a%100;
		h=(h-g)/10;
		i=a%1000;
		i=(i-10*h-g)/100;
		j=(a-100*i-10*h-g)/1000;
		printf("%04d\n", 1000*g+100*h+10*i+j);
	}
	return 0;
}
int main()
{
	int n,x,a,b,c,d;
	scanf("%d",&n);
	if(n<10){
		printf("%d\n",n);
	}
	if(n>=10&&n<100){
		a=n%10;
		b=(n-a)/10;
		printf("%d%d\n",a,b);
	}
	if(n>=100&&n<1000){
		a=n%10;
		b=(n-a)/10%10;
		c=(n-b*10-a)/100;
		printf("%d%d%d\n",a,b,c);
	}
	if(n>=1000&&n<10000){
		a=n%10;
		b=(n-a)/10%10;
		c=(n-b*10-a)/100%10;
		d=(n-c*100-b*10-a)/1000;
		printf("%d%d%d%d\n",a,b,c,d);
	}
	if(n==10000){
        printf("00001\n");
    }
	return 0;
}
int main()
{int n;
scanf("%d",&n);
int s;
if(n==0)
{printf("0");return 0;}
 
while(n!=0)
{
	s=n%10;
	n/=10;
	printf("%d",s);
}
  
  return 0;
}
int main()
{
	int n,a,b,c,d;
	cin>>n;
	a=n/1000;
	  if(a!=0)
	  {
		  b=n/100-10*a;
		  c=n/10-100*a-10*b;
		  d=n-1000*a-100*b-10*c;
		  cout<<d<<c<<b<<a<<endl;
	  }
	  else if(n/100!=0)
      {
		  b=n/100;
		  c=n/10-b*10;
		  d=n-100*b-10*c;
		  cout<<d<<c<<b<<endl;
	  }
	  else if(n/10!=0)
	  {
		  c=n/10;
		  d=n-c*10;
		  cout<<d<<c<<endl;
	  }
	  else
		  cout<<n<<endl;
	  return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	if((n>=0)&&(n<=9))
		printf("%d",n);//?????????
	else
	{
	do
	{
		printf("%d",n%10);
		n=n/10;
	}while(n/10!=0);
	printf("%d",n);
	}
	return 0;
}
int main()
{
    int n,a[5],i,j,t,re=0,k;
    scanf("%d",&n);
    if(n==0) printf("0");
    t=1;
    for(i=0;i<5;i++)
    {
                    t=(int)(pow(10,i+1)+0.5);
                    a[i]=10*(n%t)/t;
                    n=n-a[i]*t/10;
    }
    i=4;
    while(a[i]==0)
    {
           i=i-1;
           }
    for(j=0;j<=i;j++) printf("%d",a[j]);//re=re+a[j]*(int)(pow(10,i-j)+0.5);
    //printf("%d",re);
    //scanf("%d",&n);
    return 0;
}