semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int a,b,c,d,e;
    scanf("%d",&a);
    if(a<10)
    {
       b=a;
       printf("%d",b);
    }
    else if(a<100)
    {
       b=a/10;
       c=a%10;
       printf("%d%d",c,b);
    }
    else if(a<1000)
    {
      b=a/100;
      c=(a%100)/10;
      d=a%10;
      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;
}
main()
{
	int n;
	int w,a=0,b=0,c=0,d=0,e=0,x;
	scanf("%d",&n);
	a=n%10;
	x=n/10;
	if(x==0)
		w=1;
	else
	{{b=x%10;x=x/10;}
	if(x==0)
			w=2;                                
		else
		{{c=x%10;x=x/10;}
		    if(x==0)
				w=3;
			else
			{{d=x%10;x=x/10;}
			    if(x==0)
					w=4;
				else
				{w=5;e=x%10;}
	}}}
	switch(w)
	{case 5:printf("%d%d%d%d%d\n",a,b,c,d,e);
			break;
	 case 4:printf("%d%d%d%d\n",a,b,c,d);
			break;
	 case 3:printf("%d%d%d\n",a,b,c);
		    break;
	 case 2:printf("%d%d\n",a,b);
			break;
	 case 1:printf("%d\n",a);
			break;
	}
	return 0;
}
int main()
{
	int s,a,b,c,d,e;
	scanf("%d",&s);
	a=s/10000;
	b=(s-10000*a)/1000;
	c=(s-10000*a-1000*b)/100;
	d=(s-10000*a-1000*b-100*c)/10;
	e=(s-10000*a-1000*b-100*c-10*d);
	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(b!=0) printf("%d%d",e,d);
	else if(e!=0) printf("%d",e);
	else printf("0");

	return 0;
}
int main()
 {
  int a,b,c,d,e;
  scanf("%d",&a);
  if (a%10==a )  printf("%d",a);
  if (a%10!=a && a%100==a) 
      {b=a%10;
       c=((a-b)/10)%10;
       printf("%d%d",b,c);}
   if (a%10!=a && a%100!=a  && a%1000==a) 
      {b=a%10;
       c=((a-b)/10)%10;
       d=((a-b-10*c)/100)%10;
       printf("%d%d%d",b,c,d);}
    if (a%10!=a && a%100!=a  && a%1000!=a && a%10000==a) 
      {b=a%10;
       c=((a-b)/10)%10;
       d=((a-b-10*c)/100)%10;
       e=((a-b-10*c-100*d)/1000)%10;
       printf("%d%d%d%d",b,c,d,e);}
   if (a==10000)  printf("%d",00001);
  return 0;
  }
main()
{ int a,b,c;
  scanf("%d",&a);
  b=a/10000;
  if(b)
	  c=5;
  else{ b=a/1000;
      if(b)
		  c=4;
	  else{ b=a/100;
		  if(b)
			  c=3;
		  else{ b=a/10;
		  if(b)
			  c=2;
		  else c=1;}}}
  switch(c)
  {
  case 5:printf("%d%d%d%d%d\n",a%10,a%100/10,a%1000/100,a%10000/1000,a/10000);break;
  case 4:printf("%d%d%d%d\n",a%10,a%100/10,a%1000/100,a/1000);break;
  case 3:printf("%d%d%d\n",a%10,a%100/10,a/100);break;
  case 2:printf("%d%d\n",a%10,a/10);break;
  case 1:printf("%d\n",a);}
  return 0;}
int main()
{
	int a,b,c,d,e,x;
	cin>>x;
	a=x%10;                                          //????????a
	b=(x-a)%100/10;                                  //????????b
	c=(x-a-10*b)%1000/100;                          //????????c
	d=(x-a-10*b-100*c)%10000/1000;                   //????????d
	e=(x-a-10*b-100*c-1000*d)%100000/10000;          //????????e
	if(e==1)                                          //????????1
		cout<<1;
	else if(d!=0)                                    //???????abcd
	   cout<<a<<b<<c<<d;
	else if(d==0&&c!=0)                              //???????abc
	   cout<<a<<b<<c;
	else if (d==0&&c==0&&b!=0)                       //???????ab
	   cout<<a<<b;
	else if(d==0&&c==0&&b==0)                        //???????a
		cout<<a;
	return 0;
}
int main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
	b=a%10;
	c=(a%100-a%10)/10;
	d=(a%1000-a%100)/100;
	e=(a-a%1000)/1000;
	if(e)
		printf("%d%d%d%d",b,c,d,e);
	else
		if(d)
			printf("%d%d%d",b,c,d);
		else
		if(c)
			printf("%d%d",b,c);
		else
			printf("%d",b);
	return 0;
}
int main()
{
    int x,k;
    
    scanf("%d",&x);
    k=log10(x)+1;
    
    
    
    
    if (x==0) {
        printf("%d",x);
    }
    else
    {
    int a,e=1,k1;
    k=k-1;
    k1=k;
    while (k1>0) {
        e=e*10;
        k1=k1-1;
    }
    
    int b=0,s=2,k3,e2,x2;
    k3=k;
    e2=e;
    x2=x;
    while (s>0) {
        while (k3>=0) {
            a=x2/e2;
            k3=k3-1;
            x2=x2-a*e2;
            b=b+a*(e/e2);
            e2=e2/10;
            if (s==1) {
                printf("%d",a);
            }
        }
        k3=k;
        e2=e;
        s=s-1;
        x2=b;
    }
    }
    return 0;
}
int main()
{
	int x,y=0;
	scanf("%d",&x);
	if(x<10)
		printf("%d",x);
	else
	{
	while(x>0)
	{
		y=x%10+10*y;
			x=x/10;
	}
	if(x%10!=0)
	printf("%d",y);
	else
	printf("%03d",y);
	}
	return 0;
}
int main(int argc, char* argv[])
{
  int n,m,a,b,c,s,p;
  scanf("%d",&n);
  if(n==10000)printf("00001");
  else 
	  if(n<=9)printf("%d",n);
	  else 
		  if(n>=10&&n<=99)
		  {m=n/10;
            a=n-m*10;
			printf("%d%d",a,m);}
          else
	    if(n>=100&&n<=999)
		{s=n/100;
	    m=(n-s*100)/10;
         b=n-s*100-m*10;
           printf("%d%d%d",b,m,s);}
  else 
	  if(n>=1000&&n<=9999)
	  {m=n/10;
     
	 
	 p=n/1000;
	 s=(n-p*1000)/100;
	 b=(n-s*100-p*1000)/10;
	 c=n-p*1000-s*100-10*b;
 
	 printf("%d%d%d%d",c,b,s,p);}
  return 0;



}
main ()
{
int a,b,n,s,i;
scanf("%d",&a);
if(a==0)printf("0");
n=0;
b=a;
while(b!=0) 
{
 b=(b/10);
 n=n+1;
}
n=n-1;
for(i=0;i<=n;i++)
{
 b=a%10;
 a=a/10;
 printf("%d",b);
}
}
int main()
{
	int a,b,c,d;
	float n;
	cin>>n;
	a=floor(n/1000);
	b=floor((n-a*1000)/100);
	c=floor((n-a*1000-b*100)/10);
	d=n-a*1000-b*100-c*10;
	if(n/1000>=1)
	{
	cout<<d<<c<<b<<a<<endl;}
	if(n/1000<1 && n/100>=1)
	{	cout<<d<<c<<b<<endl;
	}
	if(n/100<1 && n/10>=1)
	{cout<<d<<c<<endl;
	}
	if(n/10<1)
	{cout<<d<<endl;}
	return 0;
}
int main()
{
	int n;
	cin>>n;
	if(n==0)
	{
		cout<<n;
	}
	else
	{
		while (n)
		{
		cout<<n%10;
		n/=10;
		}
	}
	return 0;
}
int main()
{
	int n, a, b, i;
	cin >> n;
	if ( n == 0)
		cout << n << endl;
	else
	{
	    for ( i = 1; ; i++)
		{
		    a = n / 10;
		    b = n - (a * 10);
		    if (a == 0 && b == 0)
			    break;
		    cout << b;
		    n = a;
		}
	}
	cout << endl;
    return 0;
}
int main()
{
	int n,i,j,k;
	cin>>n;
	int a[4];
	if(n==10000) cout<<"00001"<<endl;
	else if(n/10==0) j=0;
	else if(n/100==0) j=1;
	else if(n/1000==0) j=2;
	else j=3;
	for(i=j;i>=0;i--)
		{a[i]=n/pow(10,(double)i);
	     n=n-pow(10,(double)i)*a[i];}
	for(k=0;k<=j;k++)
	{cout<<a[k];}
	return 0;
}
int main()
{
	int n,a,b,c,d,e,f;
	scanf("%d",&n);

	if(n>999)
	{a=n/1000;
	b=n-a*1000;
	c=b/100;
	d=b-c*100;
	e=d/10;
	f=d-e*10;

 printf("%d",f);
  printf("%d",e);
   printf("%d",c);
   printf("%d",a);}
		
	if(n<1000&n>99)
	{a=n/100;
	b=n-a*100;
	c=b/10;
	d=b-c*10;

  printf("%d",d);
   printf("%d",c);
   printf("%d",a);}
		
	if(n<100&n>9)
	{a=n/10;
	b=n-a*10;

printf("%d",b);
   printf("%d",a);}
		
	if(n<10)
	{a=n/10;

printf("%d",n);
  }
	
	return 0;
}
//*5-1
int MyInverseitoa(int iNum, char*ch,  int radix)
{
	int iBits=0;
   //?iNum?????10????????????????? 
	do 
	{
		ch[iBits]=iNum%radix;  //
		printf("%d",ch[iBits]);
		iNum/=radix;
		iBits++;
	} while (iNum);
	ch[iBits]='\0';
	return iBits-1;
}

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 a, a1, a2, a3, a4, a5;
    cin>>a;
    a1 = a / 10000;
    a2 = (a - a1 * 10000) / 1000;
    a3 = (a - a1 * 10000 - a2 * 1000) / 100;
    a4 = (a - a1 * 10000 - a2 * 1000 - a3 * 100) / 10;
    a5 = a % 10;
    if(a < 10)
        cout<<a5<<endl;
    else if (a < 100)
        cout<<a5<<a4<<endl;
    else if (a < 1000)
        cout<<a5<<a4<<a3<<endl;
    else if (a < 10000)
        cout<<a5<<a4<<a3<<a2<<endl;
    else
        cout<<a5<<a4<<a3<<a2<<a1<<endl;

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

	return 0;
}
int main ()
{ int n,a[4];//???????
cin>>n;//???
if(n==10000)
	cout<<"00001"<<endl;//?????????10000??????
else
{a[1]=n/1000;//???
a[2]=(n-1000*a[1])/100;//???	
a[3]=(n-1000*a[1]-100*a[2])/10;//???
a[4]=(n-1000*a[1]-100*a[2]-10*a[3]);}//???
if (a[1]!=0)cout<<a[4]<<a[3]<<a[2]<<a[1]<<endl;//?????????????????????
else{if (a[2]!=0)cout<<a[4]<<a[3]<<a[2]<<endl;
     else
	   {if (a[3]!=0)cout<<a[4]<<a[3]<<endl;
	    else cout<<a[4]<<endl;
       }
    }
return 0;
}
int main()
{
	int n, i;
	cin >> n;
	if (n <= 9999 && n > 1000)
	{
		i = n / 1000 + n % 1000 / 100 * 10 + n % 100 / 10 * 100 + n % 10 * 1000;
		cout << i << endl;
	}
	else if (n == 1000)
		cout << "0001" << endl;
	else if (n <= 999 && n > 100) 
	{ 
		i = n / 100 + n % 100 / 10 * 10 + n % 10 * 100;
		cout << i << endl;
	}
	else if (n == 100)
		cout << "001" << endl;
		else if (n <= 99 && n > 10)
		{
			i = n % 10 * 10 + n / 10;
		}
		else if (n == 10)
			cout << "01" << endl;
			else if (n <= 9 && n >= 0)
				cout << n << endl;
				else
					cout << "00001" << endl;
	return 0;
}
int main()
{
int a,b,c,d,e,f;
scanf("%d",&a);
		if(a>=10000) 
			{
				b=a/10000;
				c=(a-10000*b)/1000;
				d=(a-10000*b-1000*c)/100;
				e=(a-10000*b-1000*c-100*d)/10;
				f=(a-10000*b-1000*c-100*d-10*e);
					printf("%d%d%d%d%d",f,e,d,c,b);
		}
		else if(a>=1000) 
			{
				b=0;				
				c=a/1000;				
				d=(a-10000*b-1000*c)/100;
				e=(a-10000*b-1000*c-100*d)/10;
				f=(a-10000*b-1000*c-100*d-10*e);
					printf("%d%d%d%d",f,e,d,c);
		}
		else if(a>=100)
		{
			b=0;
		    c=0;
			d=a/100;
			e=(a-10000*b-1000*c-100*d)/10;
			f=(a-10000*b-1000*c-100*d-10*e);
				printf("%d%d%d",f,e,d);
		}
	else if(a>=10)
	{
		b=0;
		c=0;
		d=0;
		e=a/10;
		f=(a-10000*b-1000*c-100*d-10*e);
			printf("%d%d",f,e);
		}
	else
	{
		b=0;
	c=0;
	d=0;
	e=0;
	f=a;
		printf("%d",f);
	}
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	a=n%10;
	b=((n%100)-a)/10;
	c=((n%1000)-(10*b+a))/100;
	d=(n-100*c-10*b-a)/1000;
	if(d)
		printf("%d%d%d%d",a,b,c,d);
	else if(c)
		printf("%d%d%d",a,b,c);
	else if(b)
		printf("%d%d",a,b);
	else
		printf("%d",a);
	return 0;
}
int power(int x)
{
	int k,y=1;
	for(k=1;k<=x;k++)
		y=y*10;
	return y;
}

int main()
{
	int n,i,j,a[6],temp;
	cin>>n;
	for(i=1;i<=5;i++)
		if(n%power(i)==n)
		{
			j=i;
			break;
		}
	i=0;
	for(i=0;i<j;i++)
	{
		a[i]=n%10;
		n=n/10;
		cout<<a[i];
	}
	return 0;
}
int main(void)
{
	int n;
	cin >> n;
	if(n == 0) cout << 0;
	for(int i = 1; n != 0; i++)
	{
		cout << n % 10;
		n /= 10;
	}
	cout << endl;
	return 0;
}
int main()
  {int a[5],b=0;
  do 
  {a[b]=getchar();b++;}
  while(b<5);
  if (a[1]=='\n') printf("%c",a[0]);
  else if (a[2]=='\n') printf("%c%c",a[1],a[0]);
  else if (a[3]=='\n') printf("%c%c%c",a[2],a[1],a[0]);
  else if (a[4]=='\n') printf("%c%c%c%c",a[3],a[2],a[1],a[0]);
  else printf("00001");
  return 0;
}
void main() 
{ 
	int a,temp,p,q; 
	scanf("%d",&a); 
	temp=a; 
	if(a!=0)
	{while(temp%10-temp!=0||(temp%10-temp==0&&q>=10)) 
	{ 
		p=temp%10; 
		printf("%d",p); 
		q=temp;
		temp=temp/10; 
	}
	}
	else
		printf("0");
	printf("\n");
}
int main()
{
char a[7]={'0','0','0','0','0','0','0'};
cin>>a;
int ava=0;
for (int j=6;j>=0;j--)
{
	if (ava==1)
	{
		cout<<a[j];
	}
		if (a[j]!='0')
	{
		ava=1;
	}
}
return 0;
}
int main()
{
	int n, a[5], i = 0, j;
	scanf("%d", &n);
	if (n >= 10)
	{
		while (n >= 10)
		{
			a[i] = n % 10;
			n = (n - a[i]) / 10;
			i++;
		}
		for (j = 0; j <= i - 1; j++)
			printf("%d", a[j]);
	}
	else
		;
	printf("%d", n);
}
int main ()
{
    int n,x,y,z,w,t;
    scanf("%d",&n);
    if(n<=9)
        printf("%d",n);
    else
    {    
        x=n%10;
        if(n<=99)
	{    
	    y=(n-x)/10;
            printf("%d%d",x,y);
	}
        else
        {    
            y=((n-x)/10)%10;
            t=x+10*y;
            if(n<=999)
	    {    
	        z=(n-t)/100;
                printf("%d%d%d",x,y,z);
	    }
            else
            {    
                z=((n-t)/100)%10;
                t=x+10*y+100*z;
                if(n<=9999)
		{     
	            w=(n-t)/1000;
                    printf("%d%d%d%d",x,y,z,w);
		}
            	else
                    printf("00001");
            }
        }
     }
     return 0;
}
void reverse() {
    int k;
    if ((k = getchar()) == '\n') return;
    reverse();
    printf("%c", k);
}

int main() {
    reverse();
    return 0;
}
int main()
{
    int n,a,c;
    scanf("%d",&n);
    c=0;
    if(n!=0)
    for(;n!=0;n=n/10)
    {
    a=n%10;
    printf("%d",a);
    
             }
    else 
     printf("0");
    return(0);
    
    
}
int main()
{
	int n;
	cin>>n;
	if((n>=1)&&(n<=9))cout<<n<<endl;
	if((n>=10)&&(n<100))
	{
		int a=n/10;
		int b=n%10;
		cout<<b<<a<<endl;
	}
	if((n>=100)&&(n<=999))
	{
		int a=n/100;
		int b=(n%100)/10;
		int c=(n%100)%10;
		cout<<c<<b<<a<<endl;
	}
	if((n>=1000)&&(n<9999))
	{
		int a=n/1000;
		int b=(n%1000)/100;
		int c=((n%1000)%100)/10;
		int d=((n%1000)%100)%10;
		cout<<d<<c<<b<<a;
	}
	return 0;
}
void main()
{
 int x,a,b,c,d;
 scanf("%d",&x);
 a=x%10;
  b=(x%100-a)/10;
  c=(x%1000-b*10-a)/100;
  d=x/1000;
 if (x>999&&x<10000) printf("%d%d%d%d\n",a,b,c,d);
 else if(x>99&&x<1000) printf("%d%d%d\n",a,b,c);
 else if(x>9&&x<100)   printf("%d%d\n",a,b);
 else if (x>0&&x<10)   printf("%d\n",a);
 else if (x==0) printf("0\n");
 else if (x==10000) printf("00001\n");
	 
}
int main()
{
	int num,i,j;
	int bit[5];
	i=1;
	cin>>num;
         if (num==0)
         {
              cout<<0;
              return 0;
         }
	while (num>0)
	{
		bit[i]=num%10;
		num=num/10;
		i=i+1;
	}
	for (j=1;j<i;j++) cout<<bit[j];
	return 0;
}
int main()
{
 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%100)/10;
 e=n%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");
  return 0;
}
int main()
{
    char s[10];
    scanf("%s", &s);
    int n = 0, i = 0;
    for ( i = 0; s[i]!='\0'; i++ )
        n++;
    for ( i = n-1; i >= 0; i-- )
        printf("%c", s[i]);
    return 0;
}
int main()
{ 
 int n,len=0,temp[6];
 cin>>n;
if(n==0) cout<<n;
 while(n>0)
 {
  temp[len++]=n%10;
   n=n/10;
  }
  for(int i=0;i<len;i++)
  cout<<temp[i];
  return 0;
}
int main()
{
	long a1,a2,a3,a4,a5,num,len;
	a1=a2=a3=a4=a5=0;
	scanf("%d",&num);
	if (num>9) 
	{
		a1=num%10;
		a2=num/10;
		if (a2>9)
		{
			a3=a2/10;
			a2=a2%10;
			if (a3>9)
			{
				a4=a3/10;
				a3=a3%10;
				if (a4>9)
				{
					a5=a4/10;
					a4=a4%10;
					len=5;
				}
				else len=4;
			}
			else len=3;
		}
		else len=2;
	}
	else 
	{
		a1=num;
		len=1;
	}
	
	if (a5) 
	//{
//		printf("%d %d %d %d %d\n",a5,a4,a3,a2,a1);
		printf("%d%d%d%d%d\n",a1,a2,a3,a4,a5);
//	}
	else
		if (a4)
//		{
//			printf("%d %d %d %d\n",a4,a3,a2,a1);
			printf("%d%d%d%d\n",a1,a2,a3,a4);
//		}
		else 
			if (a3)
//			{
//				printf("%d %d %d\n",a3,a2,a1);
				printf("%d%d%d\n",a1,a2,a3);
//			}
			else 
				if (a2)
//				{
//					printf("%d %d\n",a2,a1);
					printf("%d%d\n",a1,a2);
//				}
				else printf("%d\n",a1);
	return 0;
}
int main()
{
   int a,b,c,d,e;
   scanf("%d",&e);
   if(e<10)
   {a=e;
      printf("%d",a);}
    else
   if(e<100)
     {a=e%10; b=(e-a)/10;
      printf("%d%d",a,b);}
    else
   if(e<1000)
         {a=e%10; b=((e-a)/10)%10; c=(int)(e/100);
         printf("%d%d%d",a,b,c);}
    else
         {a=e%10; b=((e-a)/10)%10; c=((e-b*10-a)/100)%10;  d=(int)(e/1000);
            printf("%d%d%d%d",a,b,c,d);}
return 0;






}
int main()
{
int a,r;
scanf("%d",&a);
r=a%10;
do
{
printf("%d",r);
a=a-r;
a=a/10;
r=a%10;
}
while(a>=1);
return 0;
}
int main()
{ 
int a,b,c,d,e,f,h,i,j,n;
 
 scanf("%d",&a);
    
 
 if(a>=10000)
 {
        b=a/10000;
  c=a-b*10000;
  d=c/1000;
  e=c-d*1000;
  f=e/100;
  h=e-f*100;
  j=h/10;
  i=h-j*10;
                n=10000*i+1000*j+100*f+10*d+b;

  printf("%05d",n);
 }
 else if(a>=1000)
 {
  b=a/1000;
  c=a-b*1000;
  d=c/100;
  e=c-d*100;
  f=e/10;
  h=e-f*10;
                n=1000*h+100*f+10*d+b;
  printf("%04d",n);
 }
 else if(a>=100)
 {
  b=a/100;
  c=a-b*100;
  d=c/10;
  e=c-10*d;
                n=100*e+10*d+b;
  printf("%03d",n);
 }
 else if(a>=10)
 {
  b=a/10;
  c=a-b*10;
                n=10*c+b;
  printf("%02d",n);
 }
 else if(a>=0)
  printf("%d",a);
 printf("\n");
 return 0;
}
int main()
{
	int n;
	cin>>n;
	if(n/10==0)cout<<n<<endl;
	else if(n/100==0)cout<<n%10<<n/10<<endl;
	else if(n/1000==0)cout<<n%10<<n%100/10<<n/100<<endl;
	else if(n/10000==0)cout<<n%10<<n%100/10<<n%1000/100<<n/1000<<endl;
	else if(n==10000)cout<<1<<endl;
	return 0;
}
int main()
{
   int n,a[4];
   cin>>n;
   if(n==10000) cout<<"00001"<<endl;
   else if(n==1000) cout<<"0001"<<endl;
   else if(n>1000&&n<10000)
    {   
          a[3]=n/1000;
	a[2]=(n%1000)/100;
	a[1]=(n-a[3]*1000-a[2]*100)/10;
	a[0]=n-a[3]*1000-a[2]*100-a[1]*10;
	cout<<a[0]*1000+a[1]*100+a[2]*10+a[3]<<endl;
   }
   else if(n==100) cout<<"001";
   else if(n>100&&n<1000)
   {
	  a[2]=n/100;
	  a[1]=(n%100)/10;
	  a[0]=n-a[2]*100-a[1]*10;
	  cout<<a[0]*100+a[1]*10+a[2];
   }
   else if(n==10) cout<<"01";
   else if(n>10&&n<100)
   {
	a[1]=n/10;
	a[0]=n-a[1]*10;
	cout<<a[0]*10+a[1];
   }
   else if(n>=0&&n<10) cout<<n;
   return 0;
}
int main()
{
	int b,c,d,e,a;
	scanf("%d",&a);
    if(a==10000)printf("00001");
	else
	{
		if(a>=1000)
		{
			e=(int)(a/1000),d=(int)((a-1000*e)/100),c=(int)((a-1000*e-100*d)/10),b=a%10;
		    printf("%d%d%d%d",b,c,d,e);
		}
		else
		{
			if(a>=100)
			{
				d=(int)(a/100),c=(int)((a-100*d)/10),b=a%10;
                printf("%d%d%d",b,c,d);
			}
			else
			{
				if(a>=10)
				{
					c=(int)(a/10),b=a%10;
					printf("%d%d",b,c);
				}
				else printf("%d",a);
			}
		}
	}
	return 0;
}
void main()
{
	int a,b,c;
	scanf("%d",&a);
	if (a<10)
		printf("%d",a);
	else 
		{
while (a/10!=0)
		{
			b=a/10;
			c=a-10*b;
			printf("%d",c);
			a=b;
		}
		printf("%d",a);
}
}
int main(int argc, char *argv[])
{
    long a, original;
    cin >> a;
    original = a;
    int dig1, dig2, dig3, dig4, dig5;
    int NumofDig;
    dig1 = a/10000;
    a = a - 10000*dig1;
    dig2 = a/1000;
    a = a - 1000*dig2;
    dig3 = a/100;
    a = a - 100*dig3;
    dig4 = a/10;
    a = a - 10*dig4;
    dig5 = a;
    if(dig1)
    NumofDig = 5;
    else
        {
        if(dig2)
        NumofDig = 4;
        else
            {
            if(dig3)
            NumofDig = 3;
            else
                {
                if(dig4)
                NumofDig = 2;
                else
                NumofDig = 1;
                }
            }
        }
    long Oppo;
    Oppo = dig5*10000 + dig4*1000 +dig3*100 +dig2*10 +dig1;
    switch(NumofDig)
    {
        case 5 :
             cout << "00001" <<endl;
             break;
        case 4 :
             cout << dig5 << dig4 << dig3 << dig2 <<endl;
             break;
        case 3 :
             cout << dig5 << dig4 << dig3 <<endl;
             break;
        case 2 :
             cout << dig5 << dig4 <<endl;
             break;       
        case 1 :
             cout << dig5 <<endl;
             break; 
    }
      
  return EXIT_SUCCESS;
}
int main (void)
{
	int a = 0, b = 0, c = 0, i = 1;
	cin >> a;

	do
	{
		c = a%10;
		a = (a - c)/10;
		cout << c;
	}
	while (a != 0);

	cout <<endl;


	return 0;
}
int main()
{
 int i=1,n,m,p;
 scanf("%d",&n);
 if(n==10000)printf("00001");
 else if(n<=9) m=1;
 else if(n<100) m=2;
 else if(n<1000) m=3;
 else if(n<10000) m=4;
 while(i<=m)
 {
    p=n-n/10*10;
    printf("%d",p);
    n=n/10;
    i++;
 }
 return 0;
 }
int main()
{
    int i;
   char a[5],c;
    memset(a,' ',sizeof(a));
      cin.getline(a,5);
      for(i=5;i>=0;i--)
    {
        if(a[i]=='0'||a[i]=='1'||a[i]=='2'||a[i]=='3'||a[i]=='4'||a[i]=='5'||a[i]=='6'||a[i]=='7'||a[i]=='8'||a[i]=='9')
       {
          cout << a[i] ;
       }
    }
return 0;
}
int main () {
     
    int in,k,m,sum=0;                    //m??????????321?????????1 
    scanf("%d",&in);
    if (in==100) printf("001");
    else {k=in; 
         for(;k>0;){
            m=k%10;
            k=k/10;
            sum=sum*10+m;
            }
         printf("%d",sum);}        
         return 0;
               }
int main()
{
	int b=0,n,c,i,a[5];
	cin>>n;
	if(n==0) {cout<<'0'<<endl;}
	else
	{
	for(i=0;n>0;i++)
		{c=n%10;
		a[i]=c;
		n=n/10;
		b+=1;}//???n?10????????,??n?10???????n
    for(i=0;i<b;i++)
	   cout<<a[i];
	cout<<endl;
	}
	return 0;
}
int main()

{
	int n,a,b,c,d,place;
	scanf("%d",&n);
	if(n>=1000)
		place=4;
    else if(n>99)
		place=3;
    else if(n>9)
		place=2;
	else
		place=1;
	 a=n/1000;
	 b=(int)(n-a*1000)/100;
	 c=(int)(n-a*1000-b*100)/10;
	 d=(int)n%10;
	switch(place)
	{
	case 4:
		printf("%d%d%d%d\n",d,c,b,a);
		break;
    case 3:
		printf("%d%d%d\n",d,c,b);
		break;
    case 2:
		printf("%d%d\n",d,c);
		break;
	case 1:
		printf("%d\n",d);
		break;
	}
	return 0;
}
int main()
{
	int i,a[6],n,m,q;//????a[6]???????100000???????????i???n????????m?q 
	int b=0;//??????b?????? 
	cin>>n;//?? 
	for(i=1; ; i++)//????break??????? 
	{
		m=n/10;//????n??n-1? 
		q=n-10*m;//????n????? 
		a[i]=q;//?????a[1] 
		n=m;//?n-1???n??? 
		b++;//???? 
		if(n==0)//?????? 
		break;
		
	}
	for(i=1;i<=b;i++)//???????b?????b?????? 
	cout<<a[i];
	cout<<endl;
	
	return 0;
}
int main()
{
	int a,a1,a2,a3,a4,b;
	scanf("%d",&a);
	a1=a/1000;
	b=a-a1*1000;
	a2=b/100;
	b=b-a2*100;
	a3=b/10;
	a4=b-a3*10;
	b=a1+a2*10+a3*100+a4*1000;
	if(a>999)
	{
	if(b>999)
		printf("%d\n",b);
	else if(b>99)
		printf("0%d\n",b);
	else if(b>9)
		printf("00%d\n",b);
	else printf("000%d\n",b);
	}
	else if(a>99)
	{
	b=b/10;
	if(b>99)
		printf("%d\n",b);
	else if(b>9)
		printf("0%d\n",b);
	else printf("00%d\n",b);
	}
	else if(a>9)
	{
	b=b/100;
    if(b>9)
		printf("%d\n",b);
	else printf("0%d\n",b);
	}
	else 
	{
		b=b/1000;
		printf("%d\n",b);
	}
	return 0;
}
int main()
{
    int a,b,c,d,e;
    scanf("%d",&a);
    if(a/10000==0)
    {
        if(a/1000==0)
        {
            if(a/100==0)
            {
                if(a/10==0)
                    printf("%d\n",a);
                else
                {
                    b=a%10;
                    c=a/10;
                    printf("%d%d\n",b,c);
                }
            }
            else
                {
                    c=a/100;
                    d=(a-c*100)/10;
                    b=(a-c*100)%10;
                    printf("%d%d%d\n",b,d,c);
                }
        }
        else
        {
            b=a/1000;
            c=(a-b*1000)/100;
            d=(a-b*1000-c*100)/10;
            e=(a-b*1000-c*100)%10;
            printf("%d%d%d%d\n",e,d,c,b);
        }
    }
    else
        printf("00001\n");
    return 0;
}
int main()
{
	int num,a,b,c,d;
	scanf("%d",&num);
	a=num/1000;
	b=(num-a*1000)/100;
	c=(num-a*1000-b*100)/10;
	d=num-a*1000-b*100-c*10;
	if(num==10000)
		printf("1\n");
	if(num>999)
	printf("%d%d%d%d\n",d,c,b,a);
		else if(num>99)
		    printf("%d%d%d\n",d,c,b);
		else if(num>9)
			printf("%d%d\n",d,c);
		else
			printf("%d\n",d);
		return 0;
}
int main()
{
	int n,a1,a2,b1,b2,c1,c2,d1;
	scanf("%d",&n);
	a1=n%10;
	a2=n/10;
	if(a2>0)
	{
		b1=a2%10;
	    b2=a2/10;
		if(b2>0)
		{
			  c1=b2%10;
		      c2=b2/10;
			  if(c2>0)
			  {
					d1=c2%10;
				     printf("%d%d%d%d",a1,b1,c1,d1);
			  }
			  else
				     printf("%d%d%d",a1,b1,c1);
		}
		else
			printf("%d%d",a1,b1);
	}
	else
	printf("%d",a1);
    return 0;
}
int main(void)
{

    char a[10];
    int i=0;
    int n;
    while((a[i]=getchar())!='\n')
        i++;
    n = i;
        for(i=n;i>=0;i--)
    printf("%c",a[i]);
    return 0;
}
int main()
{
    int a[10001], n, i, x;
    char ch;
    n = 0;
    while ( (ch=cin.get()) != '\n' )
    {
        a[n] = ch - '0';
        n++;
    }
    for ( i = 0; i < n / 2; i++ )
	{ 
		x = a[i];
        a[i] = a[n-i-1];
		a[n-i-1] = x;
	}
    for ( i = 0; i < n; i++ )
        cout << a[i];
   return 0;
}
int main()
{
	int n,i,a[5],t;
	cin>>n;
	a[0]=n/1000;
	a[1]=(n-1000*a[0])/100;
	a[2]=(n-1000*a[0]-100*a[1])/10;
	a[3]=n-1000*a[0]-100*a[1]-10*a[2];               //?????
	if(n>=1000)
	{
	    cout<<a[3]<<a[2]<<a[1]<<a[0];
	}
	else if(n>=100&&n<1000)                        //??????????
	{
	    cout<<a[3]<<a[2]<<a[1];
	}
	else if(n>=10&&n<100)
	{
		cout<<a[3]<<a[2];
	}
	else if(n<10)
	cout<<n;
	return 0;
}
void main()
{
	char a[5];
	int i, j;
	for(i=0; i<5; i++)
	{
		scanf("%c",&a[i]);
		if(a[i]=='\n') 
		{
			for(j=i; j<5; j++)
			{
				a[j]='\0';
			}
			break;
		}
	}
	for(i=4; i>=0; i--)
	{
		if(a[i]!='\0') printf("%c",a[i]);
	}
}