semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
  char a[7],i,j;
  scanf("%s",&a);
  for(i = 1; a[i] !='\0'; i++)
     j=i;

  for( i = j; i>=0; i--)
     printf("%c",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%10;
  if(a>0) printf("00001");
  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;
}
int main()
{
	int n,i,j,k;
	int a[4];
	cin>>n;
	if(n==10000) cout<<"00001"<<endl;
	
	if(n/10==0) i=1;
	else if(n/100==0) i=2;
	else if(n/1000==0) i=3;
	else if(n/10000==0) i=4;
	
	for(j=i;j>=1;j--)
		{a[j-1]=n/(pow(10,(double)(j-1)));
	    n=n-pow(10,(double)(j-1))*a[j-1];}
    for(k=0;k<=i-1;k++)
	{cout<<a[k];}
	return 0;
}
//*5-1
int MyInverseitoa(int iNum, char*ch,  int radix)
{
	int iBits=0;
   //?iNum?????10????????????????? 
	do 
	{
		ch[iBits++]=iNum%radix;  //
		iNum/=radix;
	} while (iNum);
	ch[iBits]='\0';
	return iBits-1;
}

int Myatoi(char*ch, int iBits)
{
	int iNumInverse=0;
	int i=0;
//100->001
	while (ch[i]=='\0')
	{
		i++;
		printf("0");
	}
	for (i=0; i<=iBits; i++)
	{
		iNumInverse=10*iNumInverse+ch[i];
	}
	return iNumInverse;
}

int main()
{
	int iNum, iNumInverse, iBits=0;

	char ch[12];  ///int ??10?
	scanf("%d", &iNum);
	if (iNum==0)
	{
		iNumInverse=iNum;
		printf("%d", iNumInverse);
	}
	else
	{
		iBits = MyInverseitoa(iNum, ch,10);  //?????'\0'
		iNumInverse = Myatoi(ch, iBits);
		printf("%d", iNumInverse);
	}

	return 0;
}
int main()
{
	int k,i;                //????????????,????
	char a[6];              //?????????????   
	for(i=1;i<=5;i++)       //??????
	{
		a[i]=getchar();
		if(a[i]=='\n')
			break;
	}
	i=i-1;                 //????
	for(k=i;k>=1;k--)      //?????
		printf("%c",a[k]);
	return 0;
}
int main()
{
    int n,i=0,k=0;
    int a[6]={0};
    cin >> n;
    do{
      a[i]=(n%10);
      n=(n-a[i])/10;
      i++;
      k++;
      }while(n!=0);
      for(i=0;i<k;i++)
      cout << a[i];
    return 0;
}
int main()
{
	int n,i,s=0,a,b;
	scanf("%d",&n);
    if(n%10==0) 
       {
       	if(n==0) printf("");
        else
        {printf("0");
	for(n=n/10;n%10==0;n=n/10)
	   {printf("0");}
	for(;n>=1;n=n/10)
	{
	i=n%10;
	s=s*10+i;
	}
	}
}
	else
		for(;n>=1;n=n/10)
	{
	i=n%10;
	s=s*10+i;
	}
	printf("%d",s);
return 0;
}
int main()
{
	char a[100];
	char b[100];
	int l;
	
	cin >> a;
	
	l = strlen(a);
	
	for(int i = 0; i < l; i ++)
	{
		b[i] = a[l - i - 1];
		cout << b[i];
	}
	
	return 0;
}
int main()
{
	int n,a[5];
	scanf("%d",&n);
	a[0]=n%10;
	a[1]=((n-a[0])%100)/10;
	a[2]=((n-a[0]-a[1])%1000)/100;
	a[3]=((n-a[0]-a[1]-a[2])%10000)/1000;
	a[4]=(n-a[0]-a[1]-a[2]-a[3])/10000;
	if(a[4]!=0)
		printf("%d%d%d%d%d\n",a[0],a[1],a[2],a[3],a[4]);
	if(a[4]==0&&a[3]!=0)
		printf("%d%d%d%d\n",a[0],a[1],a[2],a[3]);
	if(a[4]+a[3]==0&&a[2]!=0)
		printf("%d%d%d\n",a[0],a[1],a[2]);
	if(a[4]+a[3]+a[2]==0&&a[1]!=0)
		printf("%d%d\n",a[0],a[1]);
	if(a[4]+a[3]+a[2]+a[1]==0)
		printf("%d\n",a[0]);
	return 0;
}
int main()
{
 int n;
 int a[100]={0},i=0,j;
 cin>>n;
do
 {                 a[i]=n%10;
                 n=n/10;
i++;

                 }while(n!=0);
 for(j=0;j<=i-1;j++)
  {
                  cout<<a[j];
                  }
return 0;
}
int main()
{
int a,n;
scanf("%d",&n);
if(n<10)
printf("%d",n);
else if(n==10)
printf("1");
else
{do
{a=n%10;
printf("%d",a);
n=(n-a)/10;
}
while(n>=10);
a=n;
printf("%d",a);
}
return 0;
}
int main()
{
	int n;
	cin>>n;
	if(n<10)
		cout<<n;
	else if(10<=n && n<100)
	{
		cout<<n%10<<n/10;
	}
	else if(n>=100 && n<=999)
	{
		cout<<n-(n/10)*10<<n/10-(n/100)*10<<n/100;
	}
	else if(n>=1000 && n<=9999)
	{
		cout<<n-(n/10)*10<<n/10-(n/100)*10<<n/100-(n/1000)*10<<n/1000;
	}
	else if (n==10000)
	{
		cout<<00001;
	}
	return 0;
}
int main()
{
	int i,k,x,a,b,c,d,e,x1,x2,x3,x4,x5;
	k=0;
	scanf("%d",&x);
	a=x/10000;
	b=(x%10000)/1000;
	c=(x%1000)/100;
	d=(x%100)/10;
	e=(x%10)/1;
	for(i=1;i<=10000;i=i*10)
	{
		if(x/i!=0)
	k=k+1;
	};
	if(k==5)
	{x5=10000*e+1000*d+100*c+10*b+a;
	printf("%d%d%d%d%d",e,d,c,b,a);}
	else if(k==4)
	{x4=1000*e+100*d+10*c+b;
	printf("%d%d%d%d",e,d,c,b);}
	else if(k==3)
	{x3=100*e+10*d+c;
	printf("%d%d%d",e,d,c);}
	else if(k==2)
	{x2=10*e+d;
	printf("%d%d",e,d);}
	else if(k==1)
	{x1=e;
	printf("%d",e);}
	else
		printf("0");
	return 0;
}
int main()
{
    int n,x,y,z,m;
    scanf("%d",&n);
    x=n%10;
    y=(n%100-n%10)/10;
    z=(n%1000-n%100)/100;
    m=n/1000;
    if(n<10)
    printf("%d",n);
    else if(n==10)
    printf("01");
    else if(n==100)
    printf("001");
    else if(n==1000)
    printf("0001");
    else if(n==10000)
    printf("00001");
    else if(n>10&&n<100)
    printf("%d%d",x,y);
    else if(n>100&&n<1000)
    printf("%d%d%d",x,y,z);
    else if(n>1000&&n<10000)
    printf("%d%d%d%d",x,y,z,m);
    return 0;
}
int main ()
{
	int n, a = 10, b = 10, c = 10, d;
	cin >> n;
	if (n == 10000) 
		cout << "1" << endl;
	else
	do
	{
		a--;
	} while ((n - a * 1000 < 0) || (n - a * 1000 >= 1000));
		n = n - a * 1000; 
	do
	{
		b--;
	} while ((n - b * 100 < 0) || (n - b * 100 >= 100));
		n = n - b * 100; 
	do
	{
		c--;
	} while ((n - c * 10 < 0) || (n - c * 10 >= 10));
		n = n - c * 10; 
	d=n;
	if ((a == 0) && (b == 0) && (c == 0))
		cout << d << endl;
	else if ((a == 0) && (b == 0))
		cout << d << c << endl;
	else if (a == 0)
		cout << d << c << b << endl;
	else cout << d << c << b << a << endl;
	return 0;
}
int main()
{
	int n; 
	cin >> n; 
	int mod;

	if (n == 0)
	{
		cout << 0 << endl;
	}
	else
	{

		while (n != 0)
		{
			mod = n % 10;
			cout << mod;
			n /= 10;
		}
	}

	cout << endl;

	return 0;
}
int main()
{
	int n,a,b,c,d,i;
	scanf("%d",&n);
	a=n/1000;
	b=(n/100)%10;
	c=(n/10)%10;
	d=n%10;
	if(a)
		printf("%d%d%d%d\n",d,c,b,a);
	else if(b)
			printf("%d%d%d\n",d,c,b);
	else if(c)
		printf("%d%d\n",d,c);
	else printf("%d\n",d);	
}
int main()
{
	int a,b[5],n,i;
	scanf("%d",&a);
        if(a!=0)
	{n=log10(a)+1;		
	for (i=0;i<=n-1;i++)
	{
		b[i]=(int)(a/pow(10,i))%10;		//??????????
	}
	for (i=0;i<=n-1;i++)
		printf("%d",b[i]);		//????
	printf("\n");}
        else printf("0");
	return 0;
}
int main()                            //?????
{
 int n,i;                            //??????n i
 cin>>n;                             //???????
 if(n==0)                            //??0???0
    cout<<0;

 else 
    for(i=1;;i++)                     //?????
     {
       static int k;                 //??????k???10?k??
       if(i==1)                      //??????k
         k=10;                      
       else k*=10;                   
       if(n<k/10)                    //???i???????
         break;                      //???????????
       else                            
       {          
         int c=n%k;                  //?????????????
         cout<<c/(k/10);             //???i???
        }    
     }
	         
  return 0;
}
int main()
{
    int a,r,i;
    scanf("%d",&a);
    r=0;
	i=0;
    while(a>0)
    {
        r=r*10+a%10;
		i=i+!(a%10);
        a=a/10;
    }
	switch(i)
	{
	case 0:
		printf("%d\n",r);break;
	case 1:
		printf("0%d\n",r);break;
	case 2:
		printf("00%d\n",r);break;
	case 3:
		printf("000%d\n",r);break;
	case 4:
		printf("0000%d\n",r);break;
	}
    return 0;
}
void main()
{
	int n,a=0,b;
	scanf("%d",&n);
	b=n;
	if(b==10000)printf("00001");
	else{
	do{
	a=a*10+n%10;
	n=n/10;
	}while(n!=0);
	if(b%10==0&&b!=0)printf("0");
    if(b%100==0&&b!=0)printf("0");
	if(b%1000==0&&b!=0)printf("0");
	printf("%d\n",a);
	}
}
int main()
{
    int n,i,m,c,j,k,t;
 scanf("%d",&n);
 i=n;c=0;j=0;
 while(i>0)
  {
        j++;
        m=i%10;
        i/=10;
        c=m+c*10;
  }
  i=c;k=0;
  while(i>0)
  {
  	k++;
  	i=i/10;
  	}
  for(t=1;t<=(j-k);t++)
  printf("0");
 printf("%d",c);
}
int main()
{
    int n,p,q,r,s,t;
    cin>>n;
    p=n%10;
    n=(n-p)/10;
    q=n%10;
    n=(n-q)/10;
    r=n%10;
    n=(n-r)/10;
    s=n%10;
    n=(n-s)/10;
    t=n;
    if(t!=0)
        cout<<p<<q<<r<<s<<t<<endl;
    else
    {
        if(s!=0)
             cout<<p<<q<<r<<s<<endl;
        else
        {
            if(r!=0)
                cout<<p<<q<<r<<endl;
            else
            {
                if(q!=0)
                    cout<<p<<q<<endl;
                else
                    cout<<p<<endl;
             }
        }
    }
    return 0;
}
int main()
{
     int n,decade,hundred,thousand;
	 cin >> n;
	 cout << n-n/10*10 ;
	 if(n >= 10)
	 {
         decade = n/10 ;
		 cout << decade-decade/10*10 ;
	 }
	 if(n >= 100)
	 {
         hundred = decade/10 ;
		 cout << hundred-hundred/10*10 ;
	 }
	 if(n >= 1000)
	 {
          thousand = hundred/10 ;
		 cout << thousand-thousand/10*10 ;
	 }
	 if(n == 10000)
	 cout << "1" << endl;
	 return 0;
}
void main()
{int a;
char b,c,d,e;
scanf("%d",&a);
b=(int)(a/1000);
c=(int)((a-1000*b)/100);
d=(int)(a/10)-c*10-100*b;
e=a-10*d-100*c-1000*b;
if(b!=0)
printf("%d%d%d%d",e,d,c,b);
if(b==0&&c!=0)
printf("%d%d%d",e,d,c);
if(a>9&&a<100)
printf("%d%d",e,d);
if(a<10)
printf("%d",e);
}
void p( int num )
{
while( num )
{
cout<<num%10;
num /= 10;
}
}
int main()
{
int l;
cin>>l;
if(l!=0)
p( l );
else
cout<<0;
return 0;
}
int main()
{
	int a,b,c,d,e,i;
    cin>>i;
    if(i/10==0)
	{
		cout<<i<<endl;
	}
    if(i/100==0&&i/10!=0)
	{
            a=i/10;
            b=i-a*10;
	cout<<b<<a<<endl;
	}
    if(i/1000==0&&i/100!=0)
	{
            a=i/100;
	        b=(i-a*100)/10;
	        c=i-a*100-b*10;
			cout<<c<<b<<a<<endl;
	}
	if(i/10000==0&&i/1000!=0)
	{
            a=i/1000;
		    b=(i-a*1000)/100;
	        c=(i-a*1000-b*100)/10;
	        d=i-a*1000-b*100-c*10;
			cout<<d<<c<<b<<a<<endl;
	}
	if(i/10000!=0)
	{
      a=i/10000;
	  b=(i-a*10000)/1000;
	  c=(i-a*10000-b*1000)/100;
	  d=(i-a*10000-b*1000-c*100)/10;
	  e=i-a*10000-b*1000-c*100-d*10;
	  cout<<e<<d<<c<<b<<a<<endl;
	}
			return 0;
}
int main()
{  
   int a,b,c,d,e;  
   scanf("%d",&a);  
   if(a<10)   
      {    b=a;    c=0;    d=0;    e=0;     printf("%d",b);    }   else    {       if(a<100)       {       b=a/10;       c=a%10;       d=0;       e=0;       printf("%d%d",c,b);       }       else       {         if(a<1000)         {b=a/100;         c=(a%100)/10;         d=a%10;         e=0;         printf("%d%d%d",d,c,b);         }         else         {             if(a<10000)             {b=a/1000;             c=(a%1000)/100;             d=(a%100)/10;             e=a%10;             printf("%d%d%d%d",e,d,c,b);          }                      }       }          }            return 0;}
int main()
{
int ace,a,b,c,d;
scanf("%d",&ace);
a=(int)(ace/1000);
b=(int)((ace-1000*a)/100);
c=(int)((ace-1000*a-100*b)/10);
d=(ace-1000*a-100*b-10*c);

if(ace>=1000) printf("%d%d%d%d",d,c,b,a);
else 
if (ace>=100) printf("%d%d%d",d,c,b);
else 
if (ace>=10) printf("%d%d",d,c);
else 
printf("%d",d);

}
int main()
{
	int i,j,n,a[5]={0},flag[5]={0};
	cin >> n;
	if(n==0)cout << 0;
	if(n!=0)
		{
			for(i=0;i<5;i++)
	{
         a[i]=n%10;
		 n=n/10;
	}
	for(i=0;i<5;i++)
	{
		for(j=i;j<5;j++)
		{
			flag[i]=flag[i]+a[j];            //??????????????????????
		}
	}
	for(i=0;i<5;i++)
	{
		if(flag[i]!=0)cout << a[i];
		else break;
	}
	}
	return 0;
}
int main()
{
    int n,i,an[10];
    scanf("%d",&n);
    int j=0;
    for(i=n;i>0;i=i/10)
    {
      an[j]=i%10;
      j++;
    }
    for(i=0;i<j;i++)
    {
     printf("%d",an[i]);
    }
    return 0;
}
int main()
{
	long x;
	int y,a,b,c,d,e;
	scanf("%ld",&x);
	y=log10(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;
	switch(y)
	{
	case 0:printf("%d",e);break;
	case 1:printf("%d%d",e,d);break;
	case 2:printf("%d%d%d",e,d,c);break;
	case 3:printf("%d%d%d%d",e,d,c,b);break;
	case 4:printf("%d%d%d%d%d",e,d,c,b,a);break;
          default: printf("0");
	}
	return 0;
}
int main()
{
    int n;
    cin >> n;
    if (n>=0&&n<=9)
    {
         cout << n << endl;
    }
    else if (n>=10&&n<=99)
    {
         int a,b;
         a=n/10;
         b=n%10;
         cout << b <<a << endl;
    }
    else if (n>=100&&n<=999)
    {
         int a,b,c;
         a=n/100;
         b=(n-100*a)/10;
         c=n-100*a-10*b;
         cout << c <<b <<a <<endl;
    }
    else if (n>=1000&&n<=9999)
    {
         int a,b,c,d;
         a=n/1000;
         b=(n-1000*a)/100;
         c=(n-1000*a-100*b)/10;
         d=n-1000*a-100*b-10*c;
         cout << d << c << b << a<< endl;
    }
    else if (n=10000)
    {
         cout <<"00001"<<endl;
    }
    return 0;
}
int main()
{
	char a[10000];
	int b,i,c;
	scanf("%s",a);
	b=strlen(a);
	i=0;
	if(b%2==0)
	{
		while(i<=(b/2-1))
		{
			c=a[b-1-i];
			a[b-1-i]=a[i];
			a[i]=c;
			i++;
		}
	}
	else
	{
			while(i<=((b-1)/2-1))
			{
				c=a[b-1-i];
				a[b-1-i]=a[i];
				a[i]=c;
				i++;
			}
	}
	printf("%s\n",a);
	return 0;
}
int main()
{
	int n,i;
	scanf("%d",&n);
	do
	{
		printf("%d",(n%10));
		n=(int)n/10;
	}while (n>0);
	return 0;
}
int main()
{
	int A,B,a[5],i=0,j=0;
	cin>>A;
	do
	 {
			B=A/10;
	        a[i]=A-B*10;
			A=B;
			i++;
			j++;
	}
	 while(A!=0);
	for(i=0;i<j;i++)
		cout<<a[i];
	return 0;
}
void main()
{
	int n,m=0,i,a[10];
	scanf("%d",&n);
	do
	{
		a[m]=n%10;
		n/=10;
		m++;
	}while(n>0);
	for(i=0;i<m;i++)
	{
		printf("%d",a[i]);
	}
	printf("\n");
}
int main()
{
int a,b,c,d,e;
scanf("%d",&a);
b=a/1000;
c=(a-1000*b)/100;
d=(a-1000*b-100*c)/10;
e=a-1000*b-100*c-10*d;
if (a==10000) printf("00001");
else b!=0?printf("%d%d%d%d",e,d,c,b):c!=0?printf("%d%d%d",e,d,c):d!=0?printf("%d%d",e,d):printf("%d",e);


return 0;
}
void main(){
	char a[5];
	int i;
	for(i=0;i<=5;i++)
	{
		scanf("%c",&a[i]);
		if((int)(a[i])==10)
			break;
	}
	for(;i>=1;i--)
	{
		printf("%c",a[i-1]);
	}	
}
int main(int argc, char* argv[])
{
	int i,n,m=1,c,g;
	scanf("%d",&n);
	for (i=1;i<=5;i++)
	{
		m=m*10;
		if ((n/m)==0)
		{
			c=i;
			break;
		}
	}
	for (i=1;i<=c;i++)
	{
		g=n%10;
		if (g==0)
		{
			printf("0");
		}
		else 
		{
			printf("%d",g);
		}
		n=n/10;
	}
	printf("\n");
	return 0;
}
int b[5],m=0;
int f(int n)
{
 int c;
 if(n==0) return (0);
 else
 {
  b[m]=n%10;
  m++;
  c=n/10;
  return f(c);}
}
void main()
{
 int n,i;
 scanf("%d",&n);
 f(n);
 for(i=0;i<m;i++)
 printf("%d",b[i]);
}
int main()
{
	int n,p;
	cin>>n;
	p=0;
	cout<<(n%10);
	while(n>9)
	{
		p=(n-(n%10))/10;
		n=p;
		cout<<(n%10);
	}
}
void main()
{
	int x,i,j,a[5];
	scanf("%d",&x);
	i=0;
	while (x>=10)
	{
		a[i]=x%10;
		x=x/10;
		i=i+1;
	}
	a[i]=x;
	for (j=0;j<=i;j++) printf("%d",a[j]);
	printf("\n");

}
int main()
{
	int a,a1,a2,a3,a4,a5,b;
	scanf("%d",&a);
	a1= a/10000;
	a2= a/1000-a1*10;
	a3= a/100-a2*10-a1*100;
	a4= a/10-a3*10-a2*100-a1*1000;
	a5= a-a4*10-a3*100-a2*1000-a1*10000;
	b = a1+a2*10+a3*100+a4*1000+a5*10000;
	if (a1==0)
		{if (a2==0)
		{if (a3==0)
		{if(a4==0)
		printf("%01d",b/10000);
		else
			printf("%02d",b/1000);}
		else
			printf("%03d",b/100);}
		else
			printf("%04d",b/10);}
	else
		printf("%05d",b);
	return 0;
}
int main()
{ 
	int n,a[6],m=0,j,i,p=0,k=0;    // ?????????????????
	cin>>n;                    // ????
	for (i=0;;i++)
	{
	a[i]=n%10;
	n=(n-a[i])/10;
	if (n!=0)
		p+=1;
	else 
		break;
	}                          //????????????
    for(i=0;i<=p;i++)
	{
		cout<<a[i];
	}
	return 0;
}
int main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
	if (a>999)
	{	b=a/1000;
	    c=(a-b*1000)/100;
		d=(a-b*1000-c*100)/10;
		e=(a-b*1000-c*100-d*10)/1;
		printf("%d%d%d%d",e,d,c,b);}
	else if (a>99)
	{	b=a/100;
		    c=(a-b*100)/10;
			d=(a-b*100-c*10)/1;
			printf("%d%d%d",d,c,b);}
	else if (a>9)
	{	b=a/10;
	    c=(a-b*10)/1;
			printf("%d%d",c,b);}
	else
		printf("%d",a);
	return 0;
		
    	
}
int main()
{
    int n,a,i;
    scanf("%d",&n);
    for (i=1;i<=5;i++)
    {
        a=n%10;
        printf("%d",a);
        n=(n-a)/10;
        if (n==0)
        break;
    }
}
int main()
{int a,b,c,d,e;
scanf("%d",&a);
if(a<10)
{printf("%d\n",a);}
else if(a<100)
{b=a%10;
c=(a-b)/10;
a=b*10+c;
printf("%02d\n",a);}
else if(a<1000)
{b=a%10;
c=((a-b)%100)/10;
d=(a-c*10-b)/100;
a=b*100+c*10+d;
printf("%03d\n",a);}
else {b=a%10;
c=((a-b)%100)/10;
d=((a-c*10-b)%1000)/100;
e=(a-d*100-c*10-b)/1000;
a=b*1000+c*100+d*10+e;
printf("%d\n",a);
}






return 0;
}
int main() {
	char str[101];		//??
	scanf("%s", str);	//??
	int len = strlen(str);
	for (int i = len - 1; i >= 0; --i)
		printf("%c", str[i]);
	printf("\n");	//?????
}
int main(int argc)
{   int i,n,c,b,a[10];
    cin>>n;   //??
	b=1;
	i=0;
	while(b!=0)
	{ a[i]=n%10;   //??????i+1??
	  b=n/10;         
	  n=b;
	  i++;}
	c=i;
	i=0;
	while (i<c)
	{cout<<a[i];i++;}   //?????
	return 0;
}
// *******************************************************
//?????????                                     *
//?????                                             *
//???2013/10/23                                       *
//???????????                                 *
//********************************************************
int main()
{
	int a,b,c,d,e,f;
	cin>>a;
	b=a/1000;
	c=(a-1000*b)/100;
	d=(a-1000*b-100*c)/10;
	e=a-1000*b-100*c-10*d;
	if(b>0)
		cout<<e<<d<<c<<b;
	else if(b==0&&c>0)
		cout<<e<<d<<c;
	else if(b==c==0&&d>0)
		cout<<e<<d;
	else
		cout<<e<<endl;
	return 0;
}
int main()
{
	char a;
	a=getchar();
	if(a<=57&&a>=48)
	{
		char b;
		b=getchar();
		if(b<=57&&b>=48)
		{
			char c;
			c=getchar();
			if(c<=57&&c>=48)
			{
				char d;
				d=getchar();
				if(d<=57&&d>=48)
				{
					char e;
					e=getchar();
					if(e<=57&&e>=48)
					printf("%c%c%c%c%c",e,d,c,b,a);
					else printf("%c%c%c%c",d,c,b,a);
				}
				else printf("%c%c%c",c,b,a);
			}
			else printf("%c%c",b,a);
		}
		else printf("%c",a);
	}
	else printf("error\n");
	return 0;
}
void main()
{
	int i,j,n,a[10];
	scanf("%d",&n);
	if(n==0)printf("0");
	for(i=0;n!=0;i++)
	{
		a[i]=n%10;
		n=n/10;
	}
	for(j=0;j<i;j++)
		printf("%d",a[j]);
}
int main()
{
	int x,a;
	cin >> x;
	if (x == 0)
		cout << "0";
	else
	{
	    while (x != 0)
	    {
		    a = x % 10;
		    x = x / 10;
		    cout << a;
	    }
	}
	cin.get();
    cin.get(); //????
	return 0;
}
int main()
{
int i=0;
char ch[100000],tes;

for(;;i++)
{
	ch[i]=getchar();
	if(ch[i]=='\n')break;

}

for(;i>=0;i--)
	cout<<ch[i];
cout<<endl;

	return 0;
}
int main(int argc, char* argv[])
{
	int a,i;
	scanf("%d", &a);
	for (i=1;i<=4;i++)
	{
	    printf("%d", a%10);
		a=a/10;
		if (a<1) break;
	}	
	return 0;
}
void f(int n,int w)
{
	int x;
	x=(int)pow(10,w-1);
	if (w!=1) f(n%x,w-1);
	printf("%d",n/x);
}
int main()
{
	int n;
	scanf("%d",&n);
	int w=(int)(log(n)/log(10))+1;
	f(n,w);
}
int invert(long m)
 {   printf("%ld", m%10);
     m = m/10;
     if (m>0)
         invert(m)  ;
 } 
main()
 {
     long n;
     
     scanf("%ld", &n);
     invert(n);
     printf("\n");
 }
int main()
{
	int n,i=0,j,a[6]={0};
	scanf("%d",&n);
	if(n==0) printf("0");
	while(n!=0)
	{
		a[i++]=n%10;
		n/=10;
	}
	for(j=0;j<i;j++)
	printf("%d",a[j]);
	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;
if(x>9999)
printf("%d%d%d%d%d",e,d,c,b,a);
else
if(x>999)
printf("%d%d%d%d",e,d,c,b);
else
if(x>99)
printf("%d%d%d",e,d,c);
else
if(x>9)
printf("%d%d",e,d);
else
printf("%d",e);
return 0;
}
int main()
{
     int a;
     scanf("%d",&a);
     int b;
     if(a==0) printf("0\n");
     else
     {
         while(a!=0)
         {
                b=a%10;
                a=a/10;
                printf("%d",b);
         }
         printf("\n");
     }
     getchar();
     getchar();
     getchar();
}
int main()
{
    int a,x,y,z,n,b,place;
    scanf("%d",&a);
	if(a>9999)
		place=5;
if(a>999)
		place=4;
else if(a>999)
		place=4;
else if(a>99)
		place=3;
else if(a>9)
		place=2;
else place=1;
    n=a/1000;
	x=a/100%10;
    y=a/10%10;
    z=a%10;
switch(place)
{case 5:printf("00001");
         break;
case 4:printf("%d%d%d%d",z,y,x,n);
 break;

case 3:printf("%d%d%d",z,y,x);
 break;

case 2:printf("%d%d",z,y);
 break;
case 1:printf("%d",z);
 break;

}

}
int main()
{
	int N;
	scanf("%d",&N);
	if (!N) cout << 0 << endl;
	else while (N)
	{
		cout << N%10;
		N/=10;
	}
	return 0;
}
int main()
{
    int n,a,b,c;
    cin >> n;
    b=n;
    c=n;
    if (n<10)
    cout << n;
    else
    {
    int length = 1,k = 10;
   while((c/k) != 0)
    {
      length++;
      k=k*10;
    }
    for (int i=1;i<=length;i++)
    {
    	cout << b%10;
		b=(b-b%10)/10;
    	
    }
    }
	return 0;
}
int main()
{
int a,b,c,d,e;
scanf("%d",&a);
     if(a>9999)
printf("00001");
     else if(a>999)
{b=a/1000;
c=(a-b*1000)/100;
d=(a-b*1000-c*100)/10;
e=(a-b*1000-c*100-d*10);
printf("%d%d%d%d",e,d,c,b);}
     else if(a>99)
{b=a/100;
c=(a-b*100)/10;
d=(a-b*100-c*10);
printf("%d%d%d",d,c,b);}
     else if(a>9)
{b=a/10;
c=(a-b*10);
printf("%d%d",c,b);}
     else
printf("%d",a);
return 0;
}
int main()
{
	int a[4],i=0;
	char mm;
	while((mm=cin.get())!='\n')
	{
		a[i]=mm-'0';
		i++;
	}
	for(int j=0;j<=i-1;j++)
	{
		printf("%d",a[i-1-j]);
	}

	return 0;
}
int main()
{
	int a=0,n=0,i=0,j=n-1;
	cin>>a;
	if(a==0)
		cout<<"0";
	else if(a!=0)
	{
	while(a>=pow(10,n))
		n=n+1;
	int c[10]={0};
	for(i=0;i<=n-1;i++)
       c[i]=a%(int)(pow(10,i+1));
	for(i=0;i<=n-1;i++)
	    c[i]=c[i]/pow(10,i);
    for(i=0;i<=n-1;i++)
	   cout<<c[i];
	}
	return 0;
}
int main()

{
	int a,b,c,d,n;
	scanf("%d",&n);
	a=(int)(n/1000);
	b=(int)(n/100-a*10);
	c=(int)(n/10-a*100-b*10);
	d=(int)(n-a*1000-b*100-c*10);
	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 a,b,i;
 scanf("%d",&a);
 b=a%10;
 printf("%d",b);
 a=a/10;
 if (a!=0)
  {
    b=a%10;
    printf("%d",b);
    a=a/10;
     if (a!=0)
      {
        b=a%10;
        printf("%d",b);
        a=a/10;
         if (a!=0)
          {
            b=a%10;
            printf("%d",b);
            a=a/10;
             if (a!=0)
             {
              b=a%10;
              printf("%d",b);
              a=a/10;
              }
           }
      }
    }
 return 0;
}
int main()
{
     int a,b,c,d;               
     cin>>a;
	 if(a>=1000)
          {
           b=a%1000;
           c=b%100;
           d=c%10;
           cout<<d<<(c-d)/10<<(b-c)/100<<(a-b)/1000<<endl;
           }
	 else if(a<1000&&a>=100)
	  {
	   b=a%100;
            c=b%10;
	   cout<<c<<(b-c)/10<<(a-b)/100<<endl;
	   }
	 else if(a<100&&a>=10)
	   {
	    b=a&10;
             cout<<b<<(a-b)/10<<endl;
	   }
	 else if(a>=0&&a<=9)
	  {
             cout<<a<<endl;
	  }
          return 0;
 }
main()
{
int n,i=0,j;
int a[5];
scanf("%d",&n);
for(;n>0;) // ? n>0 ?? a>0 
{
a[i]=n%10;
i++;
n=n/10;
}
for(j=0;j<i;j++)
printf("%d",a[j]);
getchar();
getchar();
}
int main()
{
	int n;
	scanf("%d",&n);
	if(n<10) printf("%d",n);
	else while(n)
	{printf("%d",n%10);
	 n=n/10;
	}
	return 0;
}
int main()
{
    int a,b,c,d,x,y;
	scanf("%d",&x);
	a=x/1000;
	b=(x-1000*a)/100;
	c=(x-1000*a-100*b)/10;
	d=x-1000*a-100*b-10*c;
	if(a==0) 
	{
		y=d*100+c*10+b;
		if(b==0) 
		{
	      y=d*10+c;
		  if(c==0) y=d;
		}
	}
	else y=d*1000+c*100+b*10+a;
	if(d!=0) printf("%d",y);
	if((d==0)&&(c!=0)) printf("0%d",y);
	if((d==0)&&(c==0)&&(b!=0)) printf("00%d",y);
	if((d==0)&&(c==0)&&(b==0)) printf("000%d",y);
	return 0;
}
int main()
{
	int n;//????????
	cin >>n;//????
	if (n >= 10000 ) cout <<"00001"<<endl;//???????????
	else if (n >= 1000)  cout << n%10 <<(n-n%10)/10%10 << (n-n%100)/100%10 << (n-n%1000)/1000%10 <<endl;
	     else if (n >= 100)  cout << n%10 <<(n-n%10)/10%10 << (n-n%100)/100%10 <<endl;
		       else if (n >= 10) cout << n%10 <<(n-n%10)/10%10 <<endl;
			        else cout << n <<endl;
	return 0;
}
void main()
{
	int a[5],i,j;
	for (i=0;i<5;i++)
	{
		a[i]=getchar();
	if (a[i]<48||a[i]>57)
		{
			j=i;
			break;
		}
	}
	for (i=j;i>=0;i--)
		putchar(a[i]);
}
int main()
{
	int i;
	scanf("%d",&i);
	do
	{
		printf("%d",i%10);
		i=i/10;
		
	}while(i!=0);
		return 0;
}
int main()
{
	int n,a[10];
	cin>>n;
	a[0]=n%10;                      //:????
	a[1]=(n%100)/10;            //:????
	a[2]=(n%1000)/100;   //:????
	a[3]=(n%10000)/1000;  //:????
	if (n<10 && n>=0)           //:?n???????
		cout<<n;
	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 if (n==10000)
		cout<<"00001";
	return 0;
}