semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
	int i,n,ge,shi,bai,qian,wan,place=1,j=2;
	scanf("%d",&n);
	for(i=9;i<=10000;i=i*10+9){
		if(n>i) place=j;
                j=j+1;
	}
		wan=n/10000;
        qian=(n-wan*10000)/1000;
        bai=(n-wan*10000-qian*1000)/100;
        shi=(n-wan*10000-qian*1000-bai*100)/10;
        ge=n-wan*10000-qian*1000-bai*100-shi*10;
	switch(place){
	case 5:
		printf("%d%d%d%d%d",ge,shi,bai,qian,wan);
		break;
	case 4:
        printf("%d%d%d%d",ge,shi,bai,qian);
		break;
	case 3:
        printf("%d%d%d",ge,shi,bai);
		break;
	case 2:
        printf("%d%d",ge,shi);
		break;
	case 1:
		printf("%d",n);
		break;
    default:
		printf("error");
	}
	return 0;
}
// pro.cpp : Defines the entry point for the console application.
//


int main(int argc, char* argv[])
{
	int n,b,c=11,i=1,j=1;
	scanf("%d",&n);
	
	if (n==0)
		printf("%d",n);
	else
		
		
		while(n>0)
		{
			
			b=n%10;
			printf("%d",b);	
			n=n/10;
			
			
		} 
		
		return 0;
}
int main()
{
	int n;
	scanf("%d",&n);
	if (n>=0,n<10)
		printf("%d\n",n);
	else 
		if (n>=10,n<100)
		printf("%d%d\n",n%10,n/10);
	    else 
			if (n>=100,n<1000)
				printf("%d%d%d\n",n%10,n%100/10,n/100);
	        else 
		        if (n>=1000,n<10000)
		        printf("%d%d%d%d\n",n%10,n%100/10,n/100%10,n/1000);
	        else printf("00001\n");
	return 0;
}
int main()
{
	int i,n,k,sum=1,A[5]; //????????????
	cin >> n;
	k=n;
	while(k>=10)          //???????
	{
		k=k/10;
		sum=sum+1;
	}
	for(i=0;i<sum;i++)   //????? ?
	{
		A[i]=n%10;
	    n=n/10;
	}
	for(i=0;i<sum;i++)   //?????
		cout << A[i];
	return 0;
}
int main()
{
	int n,j,k;
	int a[4];
    scanf("%d",&n);
	j=n;
	if(j<10)
		k=1;
	if(j>=10&&j<100)
		k=2;
	if(j>=100&&j<1000)
		k=3;
	if(j>=1000&&j<10000)
		k=4;
	a[3]=n/1000;
	a[2]=(n-a[3]*1000)/100;
	a[1]=(n-a[3]*1000-a[2]*100)/10;
	a[0]=n-a[3]*1000-a[2]*100-a[1]*10;
	switch(k)
	{
	case 1:
		printf("%d",a[0]);
		break;
	case 2:
		printf("%d%d",a[0],a[1]);
		break;
	case 3:
		printf("%d%d%d",a[0],a[1],a[2]);
		break;
	case 4:
		printf("%d%d%d%d",a[0],a[1],a[2],a[3]);
		break;
	}
	return 0;
}
int main ()
{
	int n, t, s;
	cin >> n;
	if ( n == 0)
		cout << "0";
	else
	{	for (int i = 10; i <= 100000; i *= 10)
		{
			t = n % i;
			s = t * 10 / i;
			if (s <= 9 && n != 0)
			{
				cout << s;
				n -= t;
			}
			else 
				break;
		}
	}
	cout << endl;
    return 0;
}
void main()
{
	int n,a,b,c,d;
    scanf("%d",&n);
    a=n%10;
    printf("%d",a);
    b=(n-a)/10;
    if(b!=0)
	{b=b%10;
       printf("%d",b);
       c=(n-10*b-a)/100;
       if(c!=0)
	   {
          c=c%10;
          printf("%d",c);
          d=(n-100*c-10*b-a)/1000;
          if(d!=0)
             printf("%d\n",d);
	   }
	}
}
//************************************
//*  ?? ?:5_2.cpp                 *
//*  ?   ?:???                  *
//*  ????:2013.10.14             *
//*  ????:????               *
//************************************
int main()
{
  int n,m=0;
  cin>>n;
  if(n==0)
  cout<<"0"<<endl;
  else
  {
  for(int i=4;i>=0;i--)
  {
    if(floor(n/pow(10.0,i))!=0)
    {
      if(i>=m) 
      {                        
        m=i;
      }
     }
   }
   int p[m+2],q[m+1];
  for(int j=0;j<m+2;j++)
  {
     p[j]=n%(int)pow(10.0,j);
  }
   for(int k=0;k<m+1;k++)
   {
      q[k]=(p[m+1-k]-p[m-k])/(int)pow(10.0,m-k);
   }  
   for(int t=0;t<m+1;t++)
   {       
   cout<<q[m-t];
  }
  } 
   return 0;
}
int main()
{
    int x,a,b,c,d,e;
    scanf("%d",&x);
    a=x/10000;
    b=(x%10000)/1000;
    c=(x%1000)/100;
    d=(x%100)/10;
    e=x%10;
    printf("%d",e);
    if(d||c||b||a) printf("%d",d);
    if(c||b||a) printf("%d",c);
    if(b||a) printf("%d",b);
    if(a) printf("%d",a);
    return 0;
}
int main()
{
	int n,a,b,c,d,x;
	scanf("%d",&n);
	x=n;
	a=n/10000;
	n=n%10000;
	b=n/1000;
	n=n%1000;
	c=n/100;
	n=n%100;
	d=n/10;
	n=n%10;
	if(x<10)
		printf("%d\n",n);
	else
	{
		if(x<100)
			printf("%d%d\n",n,d);
		else
		{
			if(x<1000)
				printf("%d%d%d\n",n,d,c);
			else
			{
				if(x<10000)
					printf("%d%d%d%d\n",n,d,c,b);
				else
					printf("%d%d%d%d%d\n",n,d,c,b,a);
			}
		}
	}
	return 0;
}
int main()
{
	int n,a,b,c,d,e;
	cin >> n;
	if(n <= 10000 && n >= 0)
	{
		a = n % 100000 / 10000;
	    b = n % 10000 / 1000;
	    c = n % 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;
}
int main()
{
int n,i;
cin>>n;
if(n>=1000)
	{int a[4];
    a[0]=n/1000;
	a[1]=(n%1000)/100;
	a[2]=(n-a[0]*1000-a[1]*100)/10;
	a[3]=n-a[0]*1000-a[1]*100-a[2]*10;
	for(i=3;i>=0;i--)
		cout<<a[i];}
 else if(n>=100)
 {int a[3];
  a[0]=n/100;
  a[1]=(n-a[0]*100)/10;
  a[2]=n-a[0]*100-a[1]*10;
  for(i=2;i>=0;i--)
  cout<<a[i];}
 else if(n>=10)
 {int a[2];
 a[0]=n/10;
 a[1]=n-a[0]*10;
 for(i=1;i>=0;i--)
 cout<<a[i];}
 else  cout<<n;
 return 0;
}
int main()
{
 int a,b,c,d,e,f;
 scanf("%d",&a);
 if (a/10==0)
  printf("%d",a);
 else
  if (a/100==0)
  {
   b=a%10;
   c=a/10;
   d=10*b+c;
    if (b==0)
     printf("0%d",d);
    else
     printf("%d",d);
  }
  else
   if (a/1000==0)
   {
    b=a%10;
    c=a/100;
    d=a/10-10*c;
    e=100*b+10*d+c;
     if (b==0)
      if (d==0)
       printf("00%d",e);
      else
       printf("0%d",e);
     else
     printf("%d",e);
   }
   else
    if (a/10000==0)
    {
     b=a%10;
     c=a/1000;
     d=a/100-10*c;
     e=a/10-10*d-100*c;
     f=1000*b+100*e+10*d+c;
     if (b==0)
      if (e==0)
       if (d==0)
        printf("000%d",f);
       else
        printf("00%d",f);
      else
       printf("0%d",f);
     else
      printf("%d",f);
    }
    else
     printf("00001");
 return 0;
}
main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	a=n/1000;
	b=(n-1000*a)/100;
	c=(n-1000*a-100*b)/10;
	d=n%10;
	if(n<10)
		printf("%d\n",n);
	else if(n<100)
		printf("%d%d\n",d,c);
	else if(n<1000)
		printf("%d%d%d\n",d,c,b);
	else if(n<10000)
		printf("%d%d%d%d\n",d,c,b,a);
}
int main()
{
 int i=0,j;
 char a[100];
 while((a[i]=cin.get())!='\n')
 {
  i++;
 }
 for(j=i-1;j>=0;j-=1)
 {
  cout<<a[j];
 }
 
 return 0;
  }
//********************************************************
//*    ??   1100012931                                 *
//*    ??:  ?????                                 *
//*    ???  2011.10.23                                *
//********************************************************
int main()
{
    int n,b,i,k;
	cin>>n;
	b=n;
	if(b==0)
		cout<<b;
	for(i=0;b>=1;i++)
	{
		k=b%10;//?????????????
		b=b/10;//????????
	    cout<<k;
	}
	return 0;
}
int main()
{
	int j=0,k,n,a[10],i=0;
	cin>>n;
	k=n;
	while(k>0)
	{
		a[i]=k%10;    //???????
		k=k/10;
		i++;
		j++;          //????
	}
	if(n==0)
	{
		a[0]=0;
		j=1;
	}
	for(i=0;i<j;i++)
		cout<<a[i];   //????????
	cout<<endl;
	return 0;
}
void main()
{
int n, i1, m1, i2, m2, i3, m3;
scanf("%d", &n);
if(n<10){
printf("%d", n);
}
else
if(n>=10&&n<100){
i1=n%10;
m1=n/10;
printf("%d%d", i1, m1);
}
else
if(n>=100&&n<1000){
i1=n%10;m1=n/10;
i2=m1%10;m2=m1/10;
printf("%d%d%d", i1, i2, m2);
}
else
if(n>=1000&&n<9999){
i1=n%10;m1=n/10;
i2=m1%10;m2=m1/10;
i3=m2%10;m3=m2/10;
printf("%d%d%d%d", i1, i2, i3, m3);
}
else
printf("00001");
}
main()
{
      int a;
      int b,c,d,e;
      scanf("%d",&a);
      if(a==10000)
      printf("00001");
      b=a/1000;
      c=(a-b*1000)/100;
      d=(a-b*1000-c*100)/10;
      e=a-b*1000-c*100-d*10;
      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);}}
}
int main()
{
	int a,r1,r2,r3,r4,r5;
	double b;
	scanf("%d",&a);
	b=(double)a/10000;
	if(b>=1) {r5=a/10000;r4=(a-10000*r5)/1000;r3=(a-10000*r5-1000*r4)/100;r2=(a-10000*r5-1000*r4-100*r3)/10;r1=a-10000*r5-1000*r4-100*r3-10*r2;
	printf("%d%d%d%d%d\n",r1,r2,r3,r4,r5);
	}
	  else if(b>=0.1) {r4=a/1000;r3=(a-1000*r4)/100;r2=(a-1000*r4-100*r3)/10;r1=a-1000*r4-100*r3-10*r2;printf("%d%d%d%d\n",r1,r2,r3,r4);}
	   else if(b>=0.01) {r3=a/100;r2=(a-100*r3)/10;r1=a-100*r3-10*r2;printf("%d%d%d\n",r1,r2,r3);}
	    else if(b>=0.001) {r2=a/10;r1=a-10*r2;printf("%d%d\n",r1,r2);}
	     else printf("%d\n",a);
	return 0;

}
/* title:?????? *
 * author:???*
 * time:2011.9.28*/

   


int main()
{
	int n, a, b, c, d;
	cin >> n;
	a = n / 1000;
	b = (n % 1000) / 100;
	c = (n % 100) / 10;
	d = n % 10;
	if(a != 0)
	{
    	cout << d << c << b << a << endl;
	}
	else if (b != 0)
	{
		cout << d << c << b << endl;
	}
	else if (c != 0)
	{
		cout << d << c << endl;
	}
	else 
	{
		cout << d << endl;
	}
    return 0;
}
main()
{
int  sum,len,i;
int  a[10];
scanf("%d",&sum);
if (sum>=10000) len=5;
  else if(sum>=1000) len=4;
     else if(sum>=100) len=3;
       else if(sum>=10) len=2;
          else len=1;
  for (i=1;i<=len;i++)
{  a[i]=sum/(pow(10,(len-i)));
   sum=sum-a[i]*pow(10,(len-i));
}
for (i=1;i<=len;i++)
  printf("%d",a[len-i+1]);
}
int  main(){
	char num[100];
	int k=-1;
	cin >> num[0];
	for (int i = 1; num[i - 1] != '\n';i++, k++){
		cin.get(num[i]);
	}
	for (; k >= 0; k--){
		cout << num[k];
	}
	cout << endl;
	//while (1);return 0;

}
int main()
{
	int n,a,b,c,d,e,A,B,C,D,E;
	cin >> n;
	if ( n == 10000)
		cout  << "00001" << endl;
	else if ( n >=1000 && n < 10000)
	{
		a = n / 1000;
	    b = n / 100;
		c = n / 10;
		d = n % 10;
		A = d;
		B = c % 10;
		C = b % 10;
		D = a;
		cout<<A<<B<<C<<D<<endl;
	}
	else if ( n >=100 && n <1000 )
	{
		a = n /100;
	    b = n / 10;
		c = n % 10;
		A = c;
		B = b % 10;
		C = a;
		cout<<A<<B<<C<<endl;
	}
	else if ( n >=10 && n < 100 )
	{
		A = n % 10;
		B = n / 10;
		cout<<A<<B<<endl;
	}
	else
		cout<<n<<endl;
}
int n;
int num[10];
int main()
{
    int i,t=0;
    memset(num,-1,sizeof(num));
    cin>>n;
    int x=n;
    num[0]=0;
    while(n>0)
    {
              num[t]=n%10;
              n-=n%10;
              n/=10;
              t++;
    }
    for(i=0;i<t;++i)
    {
                       cout<<num[i];
    }
    if(x==0) cout<<0;
    cout<<endl;
    return 0;
}
int main()
{
	int n,a;
	scanf("%d",&n);
	if(n==0)
             printf("0");
         else 
         while(n)
	{
		a=n%10;
		n=(n-a)/10;
		printf("%d",a);
	}
	return 0;
}
int main()
{
	int n, a[50];
	cin >> n;
	if (n == 0)
		cout << 0;
	for (int i = 3; i >= 0; i--)
	{
		if (n / ((int)(pow(10.0, i))))
		{
			for (int j = i; j >= 0; j--)
			{
				a[j] = (int)n / (int)(pow(10.0,j));
				n = n - a[j] * pow (10.0, j);
			}
			for (int k = 0; k <= i; k++)
			{
				cout << a[k];
			}
			break;
		}

	}
	return 0;

}
int main()
{
	int i;
	char s[20];
	printf("\n");
	scanf("%d", &i);
	sprintf(s, "%d", i);
	for(i=strlen(s)-1; i>=0; i--)
	{
		printf("%c", s[i]);
	}
	puts("\n");

	return 0;
}
int main(int argc, char *argv[])
{

char a[6];
int i,n;
scanf("%s",a);
n=strlen(a);
for(i=1;i<=n;i++)
printf("%c",a[n-i]);
    return 0;
}
//???????
//??????
//???10.31
int main()
{
int n,a[4];
cin>>n;
if(n<10)
cout<<n<<endl;
else if(n>=10&&n<100)
{a[1]=n%10;
a[2]=(n/10)%10;
cout<<a[1]<<a[2]<<endl;}
else if(n>=100&&n<1000)
{a[1]=n%10;
a[2]=(n/10)%10;
a[3]=(n/100)%10;
cout<<a[1]<<a[2]<<a[3]<<endl;}

else if(n>=1000&&n<10000)
{a[1]=n%10;
a[2]=(n/10)%10;
a[3]=(n/100)%10;
a[4]=(n/1000)%10;
cout<<a[1]<<a[2]<<a[3]<<a[4]<<endl;}

else if(n=10000)
cout<<"00001"<<endl;
return 0;
}
int main()
{
   int s,k,a,b,c,d;
   scanf("%d",&s);
   a=(s-s%1000)/1000;
   b=(s%1000-s%100)/100;
   c=(s%100-s%10)/10;
   d=s%10;
   k=d*1000+c*100+b*10+a;
   if(a==0)
	   if(b==0)
		   if(c==0)
			   printf("%d",d);
		   else printf("%d%d",d,c);
	   else printf("%d%d%d",d,c,b); 
   else printf("%d%d%d%d",d,c,b,a);

   
   
   



   return 0;

}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	a=n/1000;
	b=n/100-10*a;
	c=n/10-100*a-10*b;
	d=n-1000*a-100*b-10*c;
	if(a==0)
	{
		if(b==0)
		{
			if(c==0)
			{
				printf("%d\n",d);
			}
			else
				printf("%d%d\n",d,c);
		}
		else
			printf("%d%d%d\n",d,c,b);
	}
	else
		printf("%d%d%d%d\n",d,c,b,a);
	return 0;
}
int main()
{
    int n=0,i,t;
    char c[10001];
    scanf("%s",c);
    for(i=0;;i++)
    {
                 if(c[i]!='\0')
                 {
                             n++;
                 }
                 else break;
    }        
    if(n%2==0)
    {
              for(i=0;i<n/2;i++)
              {
                                 t=c[i];
                                 c[i]=c[n-1-i]; 
                                 c[n-1-i]=t;
              }
    }
    else
    {
        for(i=0;i<(n-1)/2;i++)
              {
                                 t=c[i];
                                 c[i]=c[n-1-i]; 
                                 c[n-1-i]=t;
              }
    }
    printf("%s",c);
    getchar();
    getchar();
    getchar();
}
int main()
{
	int n,a,b,c,d,y;
	scanf("%d",&n);
	if(n>9999)
		y=5;
	else if(n>999)
		y=4;
	else if(n>99)
		y=3;
	else if(n>9)
		y=2;
	else y=1;
	a=n/1000;
	b=(n-a*1000)/100;
	c=(n-a*1000-b*100)/10;
	d=(n-a*1000-b*100-c*10);
	switch(y)
	{
	case 5:printf("10000");break;
	case 4:printf("%d%d%d%d",d,c,b,a);break;
	case 3:printf("%d%d%d",d,c,b);break;
	case 2:printf("%d%d",d,c);break;
	case 1:printf("%d",d);
	}
	return 0;
}
int main()
{ 
  int n,a[5];
  cin>>n;
  for(int i=0;i<5;i++)
     {
         a[i]=n%10;
         n=n/10;
         cout<<a[i];
         if(n==0) break;
         
      }
   return 0;
}
void main()
{
	int n;
	scanf("%d",&n);
	if(n<10)
		printf("%d",n);
	else
		if(n<100)
		{int a,b;
		a=n%10;
		b=(n-a)/10;
		printf("%d%d",a,b);
		}
		else
			if(n<1000)
			{int c,d,e;
			c=n%10;
			d=(n-c)/10%10;
			e=(n-10*d-c)/100;
			printf("%d%d%d",c,d,e);
			}
				else
				{int f,g,h,i;
					f=n%10;
				g=(n-f)/10%10;
				h=(n-f-10*g)/100%10;
				i=(n-f-10*g-100*h)/1000;
				printf("%d%d%d%d",f,g,h,i);
				}
				
}
int main()
{
	int n,a[5];//n??,a[i]???
	cin>>n;
	a[0]=n%10,a[1]=(n/10)%10,a[2]=(n/100)%10,a[3]=(n/1000)%10,a[4]=(n/10000)%10;
	//?????????
	 if (n<10)
	{
	cout<<a[0];
	 }
	 else if (n<100&&n>=10)
	{
      cout<<a[0]<<a[1];
	 }
	else if (n<1000&&n>=100)
	{
    cout<<a[0]<<a[1]<<a[2];
	}
	else if (n<10000&&n>=1000)
	{
    cout<<a[0]<<a[1]<<a[2]<<a[3];
	}
	else
	{
		cout<<a[0]<<a[1]<<a[2]<<a[3]<<a[4];
	}
}
int main()
{
int a,b,c,d,e,f,g,n;
scanf("%d",&n);
if(n<10)  printf("%d",n);
else if(n<100)
printf("%d%d",n%10,n/10);
else if(n<1000)
{a=n/100;b=n/10-10*a;c=n%10;
 printf("%d%d%d",c,b,a);}
else if(n<10000)
{d=n/1000;e=n/100-10*d;f=n/10-d*100-e*10;g=n%10;
printf("%d%d%d%d",g,f,e,d);}
else   printf("over");
return 0;
}
void fun(int s)
{
	if(s==0)
		return;
	else
	{
		cout<<s%10;
		fun(s/=10);
	}
}
int main()
{
	int s;
	cin>>s;
	if(s==0)
		cout<<s;
	else
	    fun(s);
    return 0;
}
int main()
{
	int x,a,b,c,d,y;
	scanf("%d",&x);
	if (x>=1000)
	{
		a=x/1000;
		b=(x-1000*a)/100;
        c=(x-1000*a-100*b)/10;
		d=x-1000*a-100*b-10*c;
		y=d*1000+c*100+b*10+a;
        printf("%04d",y);
	}
	if(x>=100 && x<1000)
	{
		a=x/100;
        b=(x-100*a)/10;
        c=x-100*a-10*b;
		y=c*100+b*10+a;
		printf("%03d",y);
	}
    if(x>=10 && x<100)
	{
		a=x/10;
		b=x-a*10;
		y=b*10+a;
		printf("%02d",y);
	}
	if(x<10)
		printf("%d",x);
	return 0;
}
void main()
{
  int a,b,c,d,e,f,g,h,i,j,k,l,m,n;
  scanf("%d",&a);
  if(a>=0&&a<=9)
	  printf("%d",a);
  else if(a>=10&&a<=99)
  {b=a%10,c=a/10;
      putchar(b);
	  putchar(c);}
  else if(a>=100&&a<=999)
  {d=a%10,e=a/10,f=e%10,g=e/10;   
  printf("%d%d%d",d,f,g);}
  else if(a>=1000&&a<=9999)
  {h=a/10,i=h/10,j=i/10,k=i%10,l=h%10,m=a%10;
  printf("%d%d%d%d",m,l,k,j);}
}
int print(int n);
int main()
{int n;
scanf("%d",&n);
print(n);
return 0;
}
int print(int n){
	int s,a,b;
	a=n;
	s=0;
	if(a==0)
		printf("0");
	else {
	while(a>0){
		b=a%10;
		printf("%d",b);
		a=a/10;
	}
	}
return 0;
}
int main()
{
	int n,a,b,c,d;
scanf("%d",&n);
a=n%10;
n=n/10;
if(n==0)
{
	printf("%d",a);
}
else
{
	b=n%10;
	n=n/10;
	if(n==0)
{
	printf("%d%d",a,b);
}
else
{
	c=n%10;
n=n/10;
d=n;
if(n==0)
{
	printf("%d%d%d",a,b,c);
}
else
{
printf("%d%d%d%d",a,b,c,d);
}
}
}
return 0;
}
int main()
{
	char str[10]={'\0'};
	cin.getline(str,10);
	for(int i=strlen(str)-1;i>=0;i--)
	{
		cout<<str[i];
	}
	return 0;
}
int main()
{
    int a,b=0,i,j;
    scanf("%d",&a);
    i=log10(a);
    for(;a>0;)
    {
        b=b*10+a%10;
        a=a/10;
    }
    j=log10(b);
    for(;i>j;i--)
        printf("0");
    printf("%d",b);
    return 0;
}
int main()
{
	int n,a,b,c,d,m;
	scanf("%d",&n);
	m=n;
	a=n%10;
	n=n/10;
	b=n%10;
	n=n/10;
	c=n%10;
	n=n/10;
	d=n%10;
	if(m<10) printf("%d",m);
		else
		if(m<100) printf("%d%d",a,b);
		else
			if(m<1000) printf("%d%d%d",a,b,c);
			else
				if(m<10000) printf("%d%d%d%d",a,b,c,d);
				return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	if (n==10000)
	{
		n=00001;
	}
	else 
	{
		if(n>=1000)
		{
			a=n%10;
			b=(n-a)%100/10;
			d=n/1000;
			c=n/100-d*10;
			printf("%d",a);
			printf("%d",b);
			printf("%d",c);
			printf("%d",d);
		}
		else
		{
			if(n>=100)
			{
				a=n%10;
				b=(n-a)%100/10;
				c=n/100;
				printf("%d",a);
				printf("%d",b);
				printf("%d",c);
			}
			else 
			{
				if(n>=10)
				{
					a=n%10;
					b=n/10;
					printf("%d",a);
					printf("%d",b);
				}
				else
				{
					printf("%d",n);
				}
			}
		}
	}
	return 0;
}
int main()
{
  int a,b,c,d,e,f;
  scanf("%d",&a);
  if(a>=10000)
  { b=a%10;
    c=a%100-b;c=c/10;
	d=a%1000-10*c-b;d=d/100;
	e=a%10000-10*c-b-100*d;e=e/1000;
	f=a-10*c-b-100*d-1000*e;
  printf("%d%d%d%d%d",b,c,d,e,f);}
  else if(a>=1000)
	  { b=a%10;
    c=a%100-b;c=c/10;
	d=a%1000-10*c-b;d=d/100;
	e=a-10*c-b-100*d;e=e/1000;
	
  printf("%d%d%d%d",b,c,d,e);}
  else if(a>=100)
	  { b=a%10;
    c=a%100-b;c=c/10;
	d=a-10*c-b;d=d/100;

	
  printf("%d%d%d",b,c,d);}
 else if(a>=10)
	  { b=a%10;
    c=a%100-b;
	
	c=c/10;d=d/100;e=e/100;f=f/10000;
	
  printf("%d%d",b,c);}
  else 
printf("%d",a);
  return 0;
}
int main()
{
    int n, v, n4, n3, n2, n1;
	double n0;
	cin >> n;
	if (n == 0)
	{
	    cout << 0 << endl;
	}
	else if (n == 10000)
	{
	    cout << 1 << endl;
	}
	else
	{
		n0 = n;
	    v = log10(n0) + 1;
		n4 = n / 1000;
		n3 = (n - n4 * 1000) / 100;
		n2 = (n - n4 * 1000 - n3 * 100) / 10;
		n1 = n - n4 * 1000 - n3 * 100 - n2 * 10;
	    switch (v)
		{
		    case 4: cout << n1 << n2 << n3 << n4 << endl;break;
			case 3: cout << n1 << n2 << n3 << endl;break;
			case 2: cout << n1 << n2 << endl;break;
			case 1: cout << n1 << endl;
		}
	}
	return 0;
}
int main()
{
     int n,i;
	 cin>>n;
	 if(n==0)
		 cout<<0;
	 else
	 {
	 for(i=0;i<=5;i++)
	 {
		 if(n/pow(10.0,i*1.0)<1)
			 break;
	 }
     for(int j=1;j<=i;j++)
	 {
		 int k=n%10;
		 cout<<k;
		 n=(n-k)/10;
	 }
	 cout<<endl;
	 }
	 return 0;
}
int main()
{
	int weishu[5] = {-1, -1, -1, -1, -1}, num, i = 0;
	cin >> num;
	do{
		weishu[i] = num % 10;
		num = num / 10;
		i++;
	}while(num > 0);
	for (i = 0; i < 5; i++)
		if (weishu[i] != -1)
			cout << weishu[i];
	return 0;
}
int main()
{
	int N,X,a,b,c,d,e;
	scanf("%d",&N);
	if(N>9999)
      X=5;
	else if(N>999)
		X=4;
	     else if(N>99)
			 X=3;
		      else if(N>9)
				  X=2;
	              else     
				  X=1;
	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);
    switch(X)
	{case 5:printf("%d%d%d%d%d\n",e,d,c,b,a);
	 break;
	 case 4:printf("%d%d%d%d\n",e,d,c,b);
	 break;
	 case 3:printf("%d%d%d\n",e,d,c);
	 break;
	 case 2:printf("%d%d\n",e,d);
	 break;
	 case 1:printf("%d\n",e);
	 break;
	}
    return 0;
}
int main()
{
	int i,a,b,c,d,e,g;
	scanf("%d ",&i);
	if ((i>=10)&&(i<100))
	{
		a=i/1000;
	b=i%10;
	g=10*b+a;
printf("%d",b);
printf("%d",a);
	}
	if ((i>0)&&(i<10))
	{
		g=i;
printf("%d",i);
	}
	if ((i>=100)&&(i<1000))
	{
		a=i/100;
	    b=(i/10)%10;
		c=i%10;
		g=100*c+10*b+a;
printf("%d",c);
printf("%d",b);
printf("%d",a);
	}
	if ((i>=1000)&&(i<10000))
	{
		
		a=i/1000;
		b=(i/100)%10;
		c=(i/10)%10;
		d=i%10;
		printf("%d",d);
printf("%d",c);
printf("%d",b);
printf("%d",a);
	}
	
	
	return 0;
}
int main()
{
	int x,a,b,c,d,e,r;
	scanf("%d",&x);
	a=x%10;
	b=(x/10)%10;
	c=(x/100)%10;
	d=(x/1000)%10;
	e=(x/10000)%10;
	if(e==0)
	{	
		if(d==0)
		{	
			if(c==0)
			{	
				if(b==0)
				{	
					r=a;
					printf("%d\n",r);
	            }
				else
					{
						r=a*10+b;
	                    printf("%02d\n",r);
				    }
	        }
			else
				{
					r=a*100+b*10+c;
	                printf("%03d\n",r);
			    }
	     }
	     else
			 {
				 r=a*1000+b*100+c*10+d;
	             printf("%04d\n",r);
		     }
	}
	else
		{
			r=a*10000+b*1000+c*100+d*10+e;
		    printf("%05d\n",r);
	    }
	return 0;
}
void fun()        
{
    char c;           
    if((c=getchar())!='\n') 
       fun();            
    putchar(c); 

}       

main()            
{
   fun();   
   getchar();     
}
int main()
{
int i,U1,U2,U3,U4,U;
scanf("%d",&i);
U1=i/1000;U2=(i-1000*U1)/100;U3=(i-1000*U1-100*U2)/10;U4=(i-1000*U1-100*U2-10*U3);
if (U1!=0)
printf("%d%d%d%d",U4,U3,U2,U1);
else
	{
	if (U2!=0)
	printf("%d%d%d",U4,U3,U2);
	else
		{
		if (U3!=0)
		printf("%d%d",U4,U3);
		else
			{
			if (U4!=0)
			printf("%d",U4);
			else
			printf("0");
			}
		}
	}
return 0;
}
int main()
{
	int a;
	scanf("%d",&a);
	if(a==0)
		printf("%d",a);
	if(a!=0){
	for(;a>0;){
		printf("%d",a%10);
		a=a/10;
	}
	}
	return 0;
}
int main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
	b=a%10;
	c=(int)(a/10)%10;
	d=(int)(a/100)%10;
	e=(int)(a/1000)%10;
	if(a>=0&&a<10)
		printf("%d\n",a);
	else if(a>=10&&a<100)
		printf("%d%d\n",b,c);
	else if(a>=100&&a<1000)
		printf("%d%d%d\n",b,c,d);
	else
		printf("%d%d%d%d\n",b,c,d,e);
	return 0;
}
//??????
int main()
{
	char a[100001];
	cin >> a;
	int l = strlen(a), i = 0;
	for (i = l - 1; i >= 0; i--)
	{
		cout << a[i];
	}
	cout << endl;
	return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	if(n/1000!=0){
		a=n/1000;n=n-1000*a;
	b=n/100;n=n-100*b;
	c=n/10;
	d=n-10*c;
	
	printf("%d%d%d%d",d,c,b,a);}
	else if(n/100!=0){
    b=n/100;n=n-100*b;
	c=n/10;
	d=n-10*c;

    printf("%d%d%d",d,c,b);
	}else if(n/10!=0){
	c=n/10;
	d=n-10*c;
	
	printf("%d%d",d,c);}
	else printf("%d\n",n);

}
int main()
{
	char a[1000];
	cin.getline (a,100);
	int i;
	int l=strlen(a);
	for (i=l-1;i>=0;i--)
		cout<<a[i];
	cout<<endl;
}
int main()
{
char a[5];
gets(a);
int i;
for(i=strlen(a);i>0;i--)
printf("%c",a[i-1]);
return 0;
}
int main()
{
	int a,b,c,d,e,f;
	scanf("%d",&a);

	if(a>=0&&a<10)
	{
		printf("%d\n",a);
	}
	else if(a>=10&&a<100) 
	{
		b=a%10;
		c=(a-b)/10;
		d=b*10+c;
		printf("%02d\n",d);
	}
	else if(a>=100&&a<1000)
	{
		b=a%10;
		c=(a-b)%100;
		d=(a-b-c)/100;
		e=b*100+c+d;
		printf("%03d\n",e);
	}
	else if(a>=1000&&a<10000)
	{
		b=a%10;
		c=(a-b)%100;
		d=(a-b-c)%1000;
		e=(a-b-c-d)/1000;
		f=b*1000+c*10+d/10+e;
		printf("%04d\n",f);
	}
    printf("\n");
	return 0;
}
int main()
{
	int i,m;
	m=1;
	char s[5];
	scanf("%s",s);
    i=strlen(s);
	i=i-1;
	while (i>=0)
	{
		printf("%c",s[i]);
		i=i-1;
	}
	return 0;
}
int main()
{
	int n,a1,a2,a3,a4;
	scanf("%d",&n);
	if (n>=1000)
	{a4=n/1000;
	 a3=(n-a4*1000)/100;
	 a2=(n-a4*1000-a3*100)/10;
	 a1=n-a4*1000-a3*100-a2*10;
	 printf("%d%d%d%d",a1,a2,a3,a4);
	}
	if (n>=100 && n<1000)
	{a3=n/100;
	 a2=(n-a3*100)/10;
	 a1=n-a3*100-a2*10;
	 printf("%d%d%d",a1,a2,a3);
	}
	if (n>=10 && n<100)
	{a2=n/10;
	 a1=n-a2*10;
	 printf("%d%d",a1,a2);
	}
	if (n<10)
	{printf("%d",n);
	}
	return 0;
}
int main()
{
	int a[5],b[5],n,i;
	cin>>n;
	if(n==10000)
	{
		cout<<00001<<endl;
	}
	else
	{
		b[0]=n;
		for(i=0;i<4;i++)
		{
		    a[i]=b[i]/pow(10.0,(double)(3-i));
			b[i+1]=b[i]%(int)(pow(10.0,(double)(3-i)));
		}
		if(a[0]!=0)
		{
			cout<<a[3]<<a[2]<<a[1]<<a[0]<<endl;
		}
		else if(a[1]!=0)
		{
			cout<<a[3]<<a[2]<<a[1]<<endl;
		}
		else if(a[2]!=0)
		{
			cout<<a[3]<<a[2]<<endl;
		}
		else
		{
			cout<<a[3]<<endl;
		}
	}
	return 0;
}
int main()
{
    int n,a,m,p,q,k,l,s;
    scanf("%d",&n);
    if(n==10000) {a=1; printf("%05d",a);}
    else if(n>=1000)
    {s=n%1000;m=(n-s)/1000;l=s%100;p=(s-l)/100;q=l%10;
     k=(l-q)/10;a=q*1000+k*100+p*10+m;printf("%04d",a);}
    else if(n>=100)
    {s=n%100;m=(n-s)/100;l=s%10;p=(s-l)/10;
     a=l*100+p*10+m;printf("%03d",a);}
    else if(n>=10)
    {s=n%10;m=(n-s)/10;a=s*10+m;printf("%02d",a);}
    else printf("%d",n);
    return 0;
}
int main()
{
	int a[4], b, i;
	scanf("%d", &b);
	if(b==10000)
		printf("00001");
	else
    {    
		for(i=0; i<=3; i++)
		    a[i]=b%(int)pow(10, i+1)/(int)pow(10, i);
	    for(i=0; i<=3; i++)
			if(b>=pow(10, i))
                printf("%d", a[i]);
	}
	return 0;
}