semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main ()
{
    int a,b,c,d,e,f,g,h,i,j,k,m,n;
    scanf("%d",&a);
if(a<=10){
printf("%d",a);}
else   
{ if(a==10||a==100||a==1000)
{printf("001");}
else{
if(100>=a&&a>=10)
    {b=a%10;
    c=(int)(a/10);
    d=10*b+a;
    printf("%d\n",d);}
    else
    { if(1000>=a&&a>=100)
    {e=(int)(a/100);
    f=(int)((a-100*e)/10);
    g=a-100*e-10*f;
    m=100*g+10*f+e;
    printf("%d\n",m);}
    else
    {h=(int)(a/1000);
    i=(int)((a-1000*h)/100);
    j=(int)((a-1000*h-100*i)/10);
    k=a-1000*h-100*i-10*j;
    n=1000*k+100*j+10*i+h;
    printf("%d\n",n);
}}} }}
int main()
{
	int a;
	scanf("%d",&a);
	if(a==10000) printf("%d%d%d%d%d",0,0,0,0,1);
	else if(a>999) printf("%d%d%d%d",a%1000%100%10,a%1000%100/10,a%1000/100,a/1000);
	else if(a>99) printf("%d%d%d",a%100%10,a%100/10,a/100);
	else if(a>9) printf("%d%d",a%10,a/10);
	else printf("%d",a);
	return 0;
}
int main()
{
	char zhengshu[10001];
	cin.getline(zhengshu, 10001);
	int length = strlen(zhengshu), i, a[10000];
	for (i = 0; i < length; i++)
	{
		a[i] = zhengshu[i] - '0';
	}
	for (i = length - 1; i >= 0; i--)
	{
		cout<<a[i];
	}
	cout<<endl;
	return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
    a=n%10;
	b=n/10%10;
	c=n/100%10;
	d=n/1000%10;
	if(n>=10)
	{
		if(n/10>=10)
		{
			if(n/100>=10)
			{
				if(n/1000<10)
			    printf("%d%d%d%d\n",a,b,c,d);
			}
		    else
	        printf("%d%d%d\n",a,b,c);
		}
	    else
	    printf("%d%d\n",a,b);
	}
	else
	printf("%d\n",n);
}
void main()
{
	int i;
	scanf("%d",&i);
	while(i)
	{
		printf("%d",i%10);
		i=i/10;
	}
}
int main()
{
	int num , a[5] , i ,  c , n , j ;
	cin >> num ;
	n = 0 ;
	for ( i = 4 ; i >= 0 ; i-- )
	{
		for ( j = 1 ; j <= i ; j ++ )
			c *= 10 ;
		a[i] =  ( ( num - num % c ) / c ) % 10 ;
		c = 1 ;
	}
	for ( i = 4 ; i >= 0 ; i-- )
	{
		if ( a[i] != 0 )
		{
			n = i ;
    		break;
		}
	}
	for ( i = 0 ; i <= n ; i++ )
		cout << a[i] ;
	return 0 ;
}
int main()
{
	int n,a,b,c;
	scanf("%d",&n);
	b=n;
    do
	{
		a=b%10;
        c=b;
		b=b/10;
        printf("%d",a);
	}
	while(c/10!=0);                                                                                                               
	return 0;
}
int main()
{
	int x,a,b,c,d,e;
	scanf("%d",&x);
	a=x/10000;
	b=x/1000-x/10000*10;
	c=x/100-x/1000*10;
	d=x/10-x/100*10;
	e=x-x/10*10;
	if(a!=0) printf("%d%d%d%d%d",e,d,c,b,a);
	else if(b!=0) printf("%d%d%d%d",e,d,c,b);
	     else if(c!=0) printf("%d%d%d",e,d,c);
		      else if(d!=0) printf("%d%d",e,d);
			       else printf("%d",e);
	return 0;
}
int main(int argc, char* argv[])
{
int a;
scanf("%d",&a);
if(a==0) printf("0");
while(a>0){
printf("%d",a%10);
a/=10;
}
	return 0;
}
int main(int argc, char* argv[])
{
 char s[80];
 int i;
 gets(s);
 for (i=strlen(s)-1; i>=0; i--)  printf("%c",s[i]);


 return 0;
}
int main()
{
	int a,b,c,d,e,f,g,n;
	scanf("%d",&a);
	if(a>=1000)
	{
		b=a/1000;
	c=a-b*1000;
	d=c/100;
	e=c-100*d;
	f=e/10;
	g=e-10*f;

	n=g*1000+f*100+d*10+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-10*b;
		n=10*c+b;
		printf("%02d",n);
		}
		else
			
		{
			printf("%d",a);
		}
		return 0;
}
int main()
{
	int n,a[4];
	cin>>n;
	if(n/10==0)
	{
		a[0]=n;
		cout<<a[0]<<endl;
	}
	else if(n/100==0)
	{
		a[0]=n/10;
		a[1]=n%10;
		cout<<a[1]<<a[0]<<endl;
	}
	else if(n/1000==0)
	{
		a[0]=n/100;
		a[1]=n%100/10;
		a[2]=n%100%10;
		cout<<a[2]<<a[1]<<a[0]<<endl;
	}
	else if(n/10000==0)
	{
		a[0]=n/1000;
		a[1]=n%1000/100;
		a[2]=n%1000%100/10;
		a[3]=n%1000%100%10;
		cout<<a[3]<<a[2]<<a[1]<<a[0]<<endl;
	}
	else if(n=10000)cout<<"1"<<endl;
	return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	if(n>9999) printf("00001");
	if(n>999&&n<10000)
	{
		a=n/1000;
		b=(n-a*1000)/100;
		c=(n-a*1000-b*100)/10;
		d=n%10;
		printf("%d%d%d%d",d,c,b,a);
	}
	if(n>99&&n<1000)
	{
		b=n/100;
		c=(n-b*100)/10;
		d=n%10;
		printf("%d%d%d",d,c,b);
	}
	if(n>9&&n<100)
	{
		c=n/10;
		d=n%10;
		printf("%d%d",d,c);
	}
	if(n<10) printf("%d",n);
	return 0;
}
int main()
{
	int n,i;
	cin>>n;
	do{
		cout<<(n%10);
        n/=10;
	}while(n>0);
		return 0;
}
int main()
{
 int i=0;
 char str[5];
 scanf("%s",str);
 while(str[i]!='\0')
  i++;
 for(i--;i>=0;i--)
 printf("%c",str[i]);
 printf("\n");
 return 0;
}
int main ( )
{
	char exp[10], t;
	int i, j;
	cin.getline(exp, 10);
	for(i = 0,j = strlen(exp)-1;i < j;i++, j--)
	{
		t = exp[i];
		exp[i] = exp[j];
		exp[j] = t;
	}
	for(i = 0;i < strlen(exp);i++)
	{
		cout << exp[i];
	}
	return 0;
}
int main()
{
	int n,a,b,c,d,x;
	scanf("%d",&n);
	
	a=n%10;
	b=(n%100-a)/10;
	c=(n%1000-b*10-a)/100;
	d=(n-c*100-b*10-a)/1000;
	if(n<10)
	{x=a;
	printf("%d\n",x);}
	else if(n<100)
	{x=a*10+b;
	printf("%02d\n",x);}
	else if(n<1000)
	{x=a*100+b*10+c;
	printf("%03d\n",x);}
	else if(n<10000)
	{x=a*1000+b*100+c*10+d;
	printf("%04d\n",x);}
	return 0;
}
int main()
{
	int a,b,c,d,e,result;
	scanf("%d",&a);
	if(a==10000) printf("00001");
	else if(a<10000&&a>=1000) 
		{
		    b=a/1000;
			c=(a-b*1000)/100;
			d=(a-b*1000-c*100)/10;
			e=a-b*1000-c*100-d*10;
			result=e*1000+d*100+c*10+b;
			printf("%04d",result);
	}
	else if(a<1000&&a>=100)
	{
		b=a/100;
		c=(a-b*100)/10;
		d=a-b*100-c*10;
		result=d*100+c*10+b;
		printf("%03d",result);
	}
	else if(a<100&&a>=10)
	{
		b=a/10;
		c=a-b*10;
		result=c*10+b;
		printf("%02d",result);
	}
	else printf("%d",a);
	return 0;
}
int main()
{
	int n,i,a[1000];
	
	scanf("%d",&n);
	if(n==0) printf("0");
	for(i=1;n>0;i++)
	{    a[i]=n%10;
		printf("%d",a[i]);
	    n=n/10;
		
		
	}
	
	return 0;
}
void main()
{ 
	int sum=0,i,t;
	char str[5]={0},str2[5]={0};
	  scanf("%s",str);
  for (i=0;str[i]!='\0';i++)
	  sum=sum+1;
  for (i=sum-1;i>=0;i--)
  { 
	  t=sum-i-1;
	  str2[t]=str[i];
  }
  printf("%s",str2);

}
int main()
{
	int n, a, b, c, d;
	cin>>n;
	a=n/1000;
	b=(n-1000*a)/100;
	c=(n-1000*a-b*100)/10;
	d=n-1000*a-b*100-c*10;
	if(a==0)
	{
		if(b==0)
		{
			if(c==0)
			{
				cout<<d<<endl;
			}
			else
			{
				cout<<d<<c<<endl;
			}
		}
		else
		{
			cout<<d<<c<<b<<endl;
		}
	}
	else
	{
		cout<<d<<c<<b<<a<<endl;
	}
	return 0; 
}
int main()
{
	int n;
	int a[5];
	int i,j;
	scanf("%d",&n);
	for (i=0;i<5;i++)
	{
		a[i]=n%10;
		n=n/10;
	}
	if (a[4]==0 && a[3]==0 && a[2]==0 && a[1]==0) printf("%d",a[0]);
	else
		if (a[4]==0 && a[3]==0 && a[2]==0) printf("%d%d",a[0],a[1]);
		else
			if (a[4]==0 && a[3]==0) printf("%d%d%d",a[0],a[1],a[2]);
			else
				if (a[4]==0) printf("%d%d%d%d",a[0],a[1],a[2],a[3]);
				else printf("%d%d%d%d%d",a[0],a[1],a[2],a[3],a[4]);
	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(a)
		printf("%d%d%d%d%d",e,d,c,b,a);
	else if(b)
		printf("%d%d%d%d",e,d,c,b);
	else if(c)
		printf("%d%d%d",e,d,c);
	else if(d)
		printf("%d%d",e,d);
	else
		printf("%d%",e);
	


	return 0;
	
}
int main()
{
int x,a,b,c,d,e;
scanf("%d",&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;
if (x>=10000&&x<=99999)
printf("%d%d%d%d%d",e,d,c,b,a);
else if (x>=1000&&x<=9999)
printf("%d%d%d%d",e,d,c,b);
else if (x>=100&&x<=999)
printf("%d%d%d",e,d,c);
else if (x>=10&&x<=99)
printf("%d%d",e,d);
else printf("%d",e);
return 0;

}
int main()
{  int a,b,c,d,n;
   scanf("%d",&n);
   if(n<=9)
   printf("%d",n);
   else
   {  if(n<=99)
      {a=n%10; b=n/10; printf("%d%d",a,b);}
      else
      {  if(n<=999)
         {a=n%10; c=n/100; b=(n%100)/10; printf("%d%d%d",a,b,c);}
         else
         { if(n<=9999)
           {a=n%10; b=(n%100)/10; c=(n%1000)/100; d=n/1000; printf("%d%d%d%d",a,b,c,d);}
           else
           printf("00001");

         }

      }

   }

return 0;


}
int main()
{
    int n, num[10000];
    int i = 0, t = 0;
    cin >> n;
    num[0] = n % 10 ;
    
    while(n / 10 != 0)
    {       t = t + 1;
            num[t] =( n / 10 ) % 10 ;
            n = n / 10;   
    }
    
    for (i;i <= t; i++)
    {
        cout << num[i];
    
    }
    
    return 0 ;

}
main()
{
    int n,a,b,c,d,e;
    scanf("%d",&n);
    a=n/10000;
    b=(n-a*10000)/1000;
    c=(n-a*10000-b*1000)/100;
    d=(n-a*10000-b*1000-c*100)/10;
    e=n-a*10000-b*1000-c*100-d*10;
    if(a)
    printf("%d%d%d%d%d\n",e,d,c,b,a);
    else if(b)
    printf("%d%d%d%d\n",e,d,c,b);
    else if(c)
    printf("%d%d%d",e,d,c);
    else if(d)
    printf("%d%d",e,d);
    else
    printf("%d",e);
    return 0;
}
int main()
{
	int num , len = 0 , i = 0;
	char *p = NULL;
	char a[ 10000 ];
	cin.getline( a , 10000 );
	len = strlen( a );
	p = &a[ len - 1 ];
	for( i = 0 ; i <= len - 1 ; i++ )
		cout << *( p - i );
	return 0;
}
int main()
{
    char s[6] = {0,0,0,0,0,0};
    scanf("%s", &s);
    int i = 0;
    for ( i = 5; i >= 1 && s[i] == 0; i-- );
    for ( ; i >= 0; i-- )
        printf("%c", s[i]);
    return 0;
}
int main()
{
	int n,m,*a,i;
	scanf("%d", &n);
	if (n != 0)
	{
		m = floor(log10(n)) + 1;
		a = (int*)malloc(sizeof(int)*m);
		for (i = 1; i <= m; i++)
		{
			*(a + i - 1) = n % 10;
			n = (n - *(a + i - 1)) / 10;
		}
		for (i = 1; i <= m; i++)
			printf("%d", *(a + i - 1));
	}
	else
		printf("0");
}
int main()
{
    int n=0,m=0,i=0;
    cin>>n;
	if(n==0)
	   cout<<0;
	else
	{
		int a[5];
	a[0]=n/10000;
	a[1]=(n-10000*a[0])/1000;
	a[2]=(n-10000*a[0]-1000*a[1])/100;
	a[3]=(n-10000*a[0]-1000*a[1]-100*a[2])/10;
	a[4]=n-10000*a[0]-1000*a[1]-100*a[2]-10*a[3];
	for(i=0;i<=4;i++)
	{
		if(a[i]!=0)
		{
			m=i;
			break;
		}
	}
	for(i=4;i>=m;i--)
	{
		cout<<a[i];
	}
	}
	

	
    return 0;
}
int main()
{
	int a,b,c,d,e,n;
	scanf("%d",&n);
	a=(int)(n/10000);
	b=(int)((n-a*10000)/1000);
	c=(int)((n-a*10000-b*1000)/100);
	d=(int)((n-a*10000-b*1000-c*100)/10);
	e=(int)(n-a*10000-b*1000-c*100-d*10);
	if(a!=0)
	printf("%d%d%d%d%d",e,d,c,b,a);
	else if(b!=0)
	printf("%d%d%d%d",e,d,c,b);
	else if(c!=0)
	printf("%d%d%d",e,d,c);
	else if(d!=0)
	printf("%d%d",e,d);
	else 
	printf("%d",e);
	return 0;
}
void main()
{
 int n;
 int indiv,ten,hundred,thousand,ten_thousand,place;
 scanf("%d",&n);
 if(n>9999)
	place=5;
 else if(n>999)
	place=4;
 else if(n>99)
	place=3;
 else if(n>9)
	 place=2;
 else
	 place=1;
ten_thousand=(int)(n/10000);
thousand=(int)((n-ten_thousand*10000)/1000);
hundred=(int)((n-10000*ten_thousand-1000*thousand)/100);
ten=(int)((n-10000*ten_thousand-1000*thousand-100*hundred)/10);
indiv=(int)(n-10000*ten_thousand-1000*thousand-100*hundred-10*ten);
switch(place)
{case 5:
        printf("%d%d%d%d%d\n",indiv ,ten,hundred,thousand,ten_thousand);
		break;
case 4:
        printf("%d%d%d%d\n",indiv,ten,hundred,thousand);
		break;
case 3:
        printf("%d%d%d\n",indiv,ten,hundred);
		break;
case 2:
        printf("%d%d\n",indiv,ten);
		break;
case 1:
        printf("%d\n",indiv);
		break;
}
}
int main()
{
    int i;
    char a[5]={'\0','\0','\0','\0','\0'};
    scanf("%s",a);
    for(i=4;i>=0;i--)
    {
        if(a[i]!='\0')printf("%c",a[i]);
    }
}
int main()
{
    int n,a,b,c,e,f,g;
    scanf("%d",&n);
    a=(int)(n/1000);
    e=n-1000*a;
    b=(int)(e/100);
    f=e-100*b;
    c=(int)(f/10);
    g=f-10*c;
    if(n>=10000)
    {printf("00001");
}
else
{
    if(n>=1000)
    {printf("%d%d%d%d",g,c,b,a);
}
else
{if(n>=100)
{
           printf("%d%d%d",g,c,b);
           }
           else
           {if(n>=10)
           {printf("%d%d",g,c);
           }
           else
           {printf("%d",g);
           }
           }
           }
           }
    return 0;
}
int main()
{
	int n,a,b,c,d,e,y;
	scanf("%d",&n);
	a=n/10000;
	b=(n-10000*a)/1000;
	c=(n-10000*a-1000*b)/100;
	d=(n-10000*a-1000*b-100*c)/10;
	e=n-10000*a-1000*b-100*c-10*d;
	if(a!=0) {printf("%d",e);
	          printf("%d",d);
			  printf("%d",c);
			  printf("%d",b);
			  printf("%d",a);}
		else if(b!=0) {printf("%d",e);
	          printf("%d",d);
			  printf("%d",c);
			  printf("%d",b);}
		else if(c!=0) {printf("%d",e);
	          printf("%d",d);
			  printf("%d",c);}
		else if(d!=0) {printf("%d",e);
	          printf("%d",d);}
		else {printf("%d",e);}
	return 0;
}
int main()
{
	int a,b,c,d,e,f;
	scanf("%d",&a);
	b=a/10;
	c=a/100;
	d=a/1000;
	e=a/10000;
	if(e>=1)
		f=5;
	else
		if(d>=1)
			f=4;
		else
			if(c>=1)
				f=3;
			else
				if(b>=1)
					f=2;
				else
					f=1;
	d=d-10*e;
	c=c-100*e-10*d;
	b=b-1000*e-100*d-10*c;
	a=a-10000*e-1000*d-100*c-10*b;
	switch(f)
	{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;
}
main()
{
      char a[10],b[10];
      gets(a);
      int i,l;
      l=strlen(a);
      for (i=0;i<l;i++)
      {
          b[l-i-1]=a[i];
      }
      b[l]='\0';
      puts(b);
      getchar();
      getchar();
}
int main()
{
	int i = 1,a,b,c,d,e;
	char ch;
	a=b=c=d=e=-1;
	while((ch = cin.get()) != '\n')
	{
		switch(i)
		{
		case 1: a = ch - '0';break;
		case 2: b = ch - '0';break;
		case 3: c = ch - '0';break;
		case 4: d = ch - '0';break;
		case 5: e = ch - '0';break;
		}
		i++;
	}
		if(e == -1 && d != -1)
		cout << d << c << b << a << endl;
		else
		if(e == -1 && d == -1 && c != -1)
		cout << c << b << a << endl;
		else
		if(e == -1 && d == -1 && c == -1&& b != -1)
		cout << b << a << endl;
		else
		if(e == -1 && d == -1 && c == -1&& b == -1&& a!= -1)
		cout << a << endl;
		else
		cout << e << d << c << b << a << endl;

	return 0;
}
void main()
{
   int n=0,num,m,a,b;
   scanf("%d",&num);
   m=num;
   do
   {n=n*10+num%10;
    num=num/10;
    }while(num!=0);
   
   int weishu(int x);
   a=weishu(m);
   b=weishu(n);
   if(a-b==4)printf("0000%d\n",n);
   else if(a-b==3)printf("000%d\n",n);
   else if(a-b==2)printf("00%d\n",n);
   else if(a-b==1)printf("0%d\n",n);
   else printf("%d\n",n);
}

int weishu(int x)
{
	int y;
	if(x>=10000)y=5;
	else if(x>=1000)y=4;
	else if(x>=100)y=3;
	else if(x>=10)y=2;
	else y=1;
	return(y);
}
main()
{
	int a,b,c,d,e,f;
	scanf("%d",&a);
	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%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 k,a,b,c,d,e,place; //*place???????*//
	scanf("%ld",&k);
	if (k>9999)
	place=5;
	else if(k>999)
		place=4;
	else if(k>99)
		place=3;
	else if(k>9)
		place=2;
	else place=1;
	switch (place)
	{
	case 1:
		printf("%d\n",k); break;
	case 2:
		d=k/10;
		e=k-d*10;
		printf("%d%d\n",e,d); break;
	case 3:
		c=k/100;
		d=(k-c*100)/10;
		e=k-c*100-d*10;
		printf("%d%d%d\n",e,d,c);break;
	case 4:
		b=k/1000;
		c=(k-b*1000)/100;
	    d=(k-b*1000-c*100)/10;
		e=k-b*1000-c*100-d*10;
		printf("%d%d%d%d\n",e,d,c,b);break;
	case 5:
		a=k/10000;
		b=(k-a*10000)/1000;
		c=(k-a*10000-b*1000)/100;
		d=(k-a*10000-b*1000-c*100)/10;
		e=k-a*10000-b*1000-c*100-d*10;
		printf("%d%d%d%d%d\n",e,d,c,b,a);
    }
	return 0;
}
int main()
{
	int m,n,p;
	int i=1;
	scanf("%d",&n);
	if (n<10)
	   p=1;
    else if (n<100)
       p=2;
    else if (n<1000)
       p=3;
    else if (n<10000)
       p=4;
	do
	{
		m=n%10;
		printf("%d",m);
		n=n/10;
		i++;
	}while(i<=p);
	return 0;
}
int main()
{
   int a,b,c,d,e,f,g,h,i;
   scanf("%d",&a);
   b=floor(a/10000);
   a=a-b*10000;
   c=floor(a/1000);
   a=a-c*1000;
   d=floor(a/100);
   a=a-d*100;
   e=floor(a/10);
   a=a-e*10;
   if(b==0)
     {if(c==0)
       {if(d==0)
         {if(e==0)
           printf("%d",a);
         else printf("%d%d",a,e);}
       else printf("%d%d%d",a,e,d);}
     else printf("%d%d%d%d",a,e,d,c);}
   else printf("%d%d%d%d%d",a,e,d,c,b);


}
main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
	b=a%10;
	printf("%d",b);
	c=a/10;
	if(c!=0)
		printf("%d",c%10);
	d=a/100;
	if(d!=0)
		printf("%d",d%10);
	e=a/1000;
	if(e!=0)
		printf("%d",e);

	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(a1 == 0 && a2 == 0 && a3 == 0 && a4 == 0)
        cout<<a5<<endl;
    else if (a1 == 0 && a2 == 0 && a3 == 0)
        cout<<a5<<a4<<endl;
    else if (a1 == 0 && a2 == 0)
        cout<<a5<<a4<<a3<<endl;
    else if (a1 == 0 )
        cout<<a5<<a4<<a3<<a2<<endl;
    else
        cout<<a5<<a4<<a3<<a2<<a1<<endl;

    return 0;
}
main()
{   int  a,b,c,d,e,f;
    scanf("%d\n",&f);
    if(f==10000)
    printf("00001");
    else if(f>=1000&&f<=9999)
      {b=(int)f/1000;
      c=(int)(f-b*1000)/100;
      d=(int)(f-b*1000-c*100)/10;
      e=f-b*1000-c*100-d*10;
      printf("%d%d%d%d",e,d,c,b);}
    else if(f>=100&&f<=999)
         {c=(int)f/100;
         d=(int)(f-c*100)/10;
         e=(f-c*100-d*10);
         printf("%d%d%d",e,d,c);}
    else if(f>=10&&f<=99)
           {d=(int)f/10;
           e=(f-d*10);
           printf("%d%d",e,d);}
    else if(f>=0&&f<=9)
           printf("%d",f);
}
int main()
{
	int a,b,c,d,e;
	scanf("%d",&a);
	d=a%10;//??
	b=(a%1000-a%100)/100;//??
	c=(a%100-d)/10;//??
	e=(a%10000-a%1000)/1000;
	if(a>=1000)
printf("%d%d%d%d\n",d,c,b,e);
	else if(a>=100)
	{
		printf("%d%d%d\n",d,c,b);
	}
	else if(a>=10)
		printf("%d%d\n",d,c);
	else
		printf("%d\n",d);
	return 0;
}
int main()
{
	int n,a[5];
	scanf("%d",&n);
	a[1]=n/10000;
	a[2]=(n-a[1]*10000)/1000;
	a[3]=(n-a[1]*10000-a[2]*1000)/100;
	a[4]=(n-a[1]*10000-a[2]*1000-a[3]*100)/10;
	a[5]=n-a[1]*10000-a[2]*1000-a[3]*100-a[4]*10;
	if (a[1]!=0)
		printf("%d%d%d%d%d",a[5],a[4],a[3],a[2],a[1]);
	else
	{
		if(a[2]!=0)
		printf("%d%d%d%d",a[5],a[4],a[3],a[2]);
		else
		{
			if(a[3]!=0)
				printf("%d%d%d",a[5],a[4],a[3]);
			else
			{
				if(a[4]!=0)
				    printf("%d%d",a[5],a[4]);
				else
				{
					if(a[5]!=0)
						printf("%d",a[5]);
					else
						printf("0");
				}
			}
		}
	}
	return 0;
}
void reverse(char s[],int a,int b){
	int i,j;
	char temp;
	for(i=a,j=b-1;i<j;i++,j--){
		temp=s[i];
		s[i]=s[j];
		s[j]=temp;
	}
	for(i=a;i<b;i++){
		printf("%c",s[i]);
	}
	printf("\n");
}

void main(){
	char string[10];
	int len;
	gets(string);
	len=strlen(string);
	reverse(string,0,len);
}
int main()
{int a,n;
  scanf("%d",&n);
if(n==0) printf("%d\n",n);
else{
for(;n>0;)
  {a=n%10;
   printf("%d",a);
   n=n/10;
   }
}
printf("\n");
return 0;
}
int main()
{
	int a,b;
	scanf("%d",&a);
	for(;a!=0;a=(a-(a%10))/10)
	{
		b=(a%10);
		printf("%d",b);
	}
		return 0;
}
int main()
{
	int x,a,b,c,d,e,f,g,h;
	scanf("%d",&x);
	a=x%10;
	b=x%100;
	c=x%1000;
	d=x%10000;
	e=(b-a)/10;
	f=(c-b)/100;
	g=(d-c)/1000;
	if (x<10)
		printf("%d\n",a);
	else if (x<100)
		printf("%d%d\n",a,e);
	else if (x<1000)
		printf("%d%d%d\n",a,e,f);
	else
		printf("%d%d%d%d\n",a,e,f,g);
	return 0;
}
int main()
{
	int n;
	void reverse(int n);
	scanf("%d",&n);
	reverse(n);
	return 0;
}
void reverse(int n)
{
	if(n < 1)
		return;
	printf("%d",n % 10);
	reverse(n / 10);
}
int main()
{
   int n;
   int tmp;
   scanf("%d",&n);
   while(1){
	   tmp=n%10;
	   printf("%d",tmp);
	   if(!(n=n/10))break;
   }
   printf("\n");
   return 0;
}
int main()
{
	int a, b, c, d, n, n1, n2;
	cin >> n;
	a = n / 1000;
	n1 = n - 1000 * a;
	b = n1 / 100;
	n2 = n1 - 100 * b;
	c = n2 / 10;
	d = n2 - 10 * c;
	if (a == 10)
		cout << "00001" << endl;
	else 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;
}
int main()
{
	int a=0,b=0,c=0,d=0,e;
	scanf("%d",&e);
	while(1000*a<=e-1000)
	{
		a++;
	}
	while(1000*a+100*b<=e-100)
	{
		b++;
	}
	while(1000*a+100*b+10*c<=e-10)
	{
		c++;
	}
	d=e-10*c-100*b-1000*a;
	if(a>0)
	{
		printf("%d%d%d%d",d,c,b,a);
	}
	else
	{if(b>0)
	{
		printf("%d%d%d",d,c,b);
	}
	else
	{if(c>0)
	{
		printf("%d%d",d,c);
	}
	else{
		printf("%d",d);
	}
	}}}
int main() {
	char str[1000];
	cin >> str;
	for (int i = strlen(str)-1; i >= 0; i--)
		cout << str[i];
	return 0;
}
int main()
{
	int i,a,b,c,d,e;
	scanf("%d",&i);
	a=i/10000;
	b=(i-a*10000)/1000;
	c=(i-10000*a-1000*b)/100;
	d=(i-10000*a-1000*b-100*c)/10;
    e=i-10000*a-1000*b-100*c-10*d;
	if(a==0&&b==0&&c==0&&d==0)printf("%d\n",e);
	else if(a==0&&b==0&&c==0)printf("%d%d\n",e,d);
	else if(a==0&&b==0)printf("%d%d%d\n",e,d,c);
	else if(a==0)printf("%d%d%d%d\n",e,d,c,b);
	else printf("%d%d%d%d%d\n",e,d,c,b,a);
}
int main()
{
	int a,n,b,c,d,e,f,g;
	scanf("%d",&n);
	b=0;
	a=n;
	if (n==0)
		printf("0");
	else
	while(a>0)
	{ 
	  a=(int)(a/10);
	  b=b+1;
	}
    c=n%10;
	d=(int)(n/10)%10;
	e=(int)(n/100)%10;
    f=(int)(n/1000)%10;
	g=(int)(n/10000);
	switch (b)
	{case 1:printf("%d\n",n);break;
   	 case 2:printf("%d%d\n",c,d);
		 break;		   
	 case 3:
		    printf("%d%d%d\n",c,d,e);
			break;
     case 4:
		   printf("%d%d%d%d\n",c,d,e,f);
			break;
   	case 5:
		   printf("%d%d%d%d%d\n",c,d,e,f,g);
			break;
	}
	return 0;
}
long num;
long digit[5];
int main()
{
   int count=0,i;
   long number;
   do
       {
           scanf("%ld",&num);
       }
   while(num<0||num>99999);
   count=0;
   number=num;
   do
       {
           digit[count++]=number%10;
           number=number/10;
       }
   while(number>0);
   for(i=0;i<count;i++)
       printf("%ld",digit[i]);
}
int main()                //???????????
{
	char ch[10];
	int n=0;
	while (cin>>ch[n])
	{
		n++;
	}
	for (int i=n-1;i>=0;i--)
		cout<<ch[i];
	return 0;
}
void function(int num){
	cout<<num%10;
	if ((num/10)!= 0) 
		function (num/10);
}
int main(){
	int num;
	cin>>num;
	function (num);
return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&n);

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

		   printf("%d%d%d",c,b,a);
		}
	    else 
		{
			if(n>=10)
			{
			a=n/10;
			b=n%10;
			printf("%d%d",b,a);
			}
		    else 
			{
			printf("%d",n);
			}
		}
	}
	return 0;
}
int main()
{
int n;
scanf("%d",&n);
if(n>9999)
{printf("00001");}
else if(n>999)
{printf("%d%d%d%d",n%1000%100%10,n%1000%100/10,n%1000/100,n/1000);}
else if(n>99)
{printf("%d%d%d",n%100%10,n%100/10,n/100);}
else if(n>9)
{printf("%d%d",n%10,n/10);}
else 
{printf("%d",n);}
return 0;
}
int main()
{
	int a,b;
	scanf ("%d",&a);
	if (a==100)
	{
		printf("001");
	}
	else
		if (a<=9)
		{
		printf("%d",a);
		}
		else
			if (a<=99)
			{
				b=a%10*10+a/10;
			printf("%d",b);
			}
			else
				if (a<=999)
				{
					b=a%10*100+(a/10)%10*10+a/100;
				printf("%d",b);
				}
				else
					if(a<=9999)
					{
						b=a%10*1000+(a/10)%10*100+(a/100)%10*10+a/1000;
					printf("%d",b);
					}
					return 0;
}
int main()
{
	int a,b;
    scanf("%d",&a);
	b=0;
	while(a)
	{
		b=a%10;
		printf("%d",b);
        a=a/10;
	}
	return 0;
}
int a[10];

int main()
{
    int x;int k=0;
    cin>>x;
    if(x==0) cout<<x<<endl;
    else
    {
    while(x>0)
    {
              a[k++]=x%10;
              x=x/10;
    }
    for(int i=0;i<k;i++)
      cout<<a[i];
    cout<<endl;
    }
    return 0;
}
int main()
{
	int n,a,b,c,d;
	scanf("%d",&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;
	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 (b!=0)
	    printf("%d%d",a,b);
	else
		printf("%d",a);
	return 0;
}
int main()
{
	char n[5];
	int i, k, j;
	cin.getline(n, 5);
	for (i = 0;n[i] != '\0'; i++)
	{
		k = i;
	}
	for (j = k; j >= 0; j--)
		cout << n[j];
	return 0 ;
}
int main()
{
	int n, a=0, i=5, m=0, b;
	cin >> n;
	do
	{
		cout << n%10;
		n=n/10;
	}while(n!=0);
	return 0;
}
int main()
{
	int a,b,c,d,e,f;
	scanf("%d",&a);
	if(a>9999)
	{
		
		b=a/10000;
		c=(a/1000)-10*b;
		d=(a/100)-100*b-10*c;
		e=(a/10)-1000*b-100*c-10*d;
		f=a-10000*b-1000*c-100*d-10*e;

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

return 0;
}