semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main()
{
    int n,i,k,out;
    int A[5];
    scanf("%d",&n);
    for(i=1;1<=5;i++)
    {
        if (n<1) break; 
         printf("%d",n%10);
         n=n/10;
     
     }
 return 0;
}
void main()
{
	int x,a,b,c,d;
	scanf("%d",&x);
	if(x==10000)
		printf("00001\n");
	else
	{
		a=x/1000;
		b=(x-a*1000)/100;
		c=(x-a*1000-b*100)/10;
		d=x-a*1000-b*100-c*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[10],n,flag;
	flag = 0;
	scanf("%d",&n);
	if(n == 0) printf("0");
	else{
		while(n != 0){
			flag ++;
			a[flag] = n % 10;
			n = n / 10;
		}
		for(int i = 1;i <= flag;i ++){
			printf("%d",a[i]);
		}
	}
	return 0;
}
int main()  
{
	int a[5]={0},n,i,j;
	cin>>n;
    a[0]=n/10000;
	a[1]=(n-a[0]*10000)/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-a[0]*10000-a[1]*1000-a[2]*100-a[3]*10;
	if(n==0)
		cout<<0;
	else
    for(i=0;i<5;i++)
	{
		if(a[i]!=0)
		{
			for(j=4;j>=i;j--)
				cout<<a[j];
			break;
		}
	}
	cout<<endl;
	return 0;
}
int main()
{
	int n;
	cin >> n;
	if (n == 0) cout << 0;
	for (int i = 0; n; i++)
	{
		cout << n % 10;
		n /= 10;
	}
    return 0;
}
//??????????
int main()
{
	char	num[5];
	cin >> num;
	int	nl = strlen(num);
	
	int	i;
	for (i = 0; i < (int)(nl / 2); i ++)
	{
		char	k;
		k = num[i];
		num[i] = num[nl - 1 - i];
		num[nl - 1 - i] = k;
	}
	
	cout << num;
	cout << endl;


	return 0;
}
int main()
{
	char num[6];
	int i,n,nnum[6],p=0;
	scanf("%s",num);
	n=strlen(num);
	
	for(i=n-1;i>=0;i--){
		nnum[i]=num[i]-48;
		printf("%d",nnum[i]);
	}
	
	return 0;
}
int main()
{
	int n,a,b,c,d,e;
	scanf("%d",&n);
	a=n/10000;
	n=n-10000*a;
	b=n/1000;
	n=n-1000*b;
	c=n/100;
	n=n-100*c;
	d=n/10;
	e=n-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(d!=0)
					printf("%d%d",e,d);
				else
					printf("%d",e);
	return 0;
}
int main()
{
	int i,count=0;
	char a[20000];
	while( ( a[count] = getchar() ) != '\n' )
	{
		count++;
	}
	for( i = count-1; i >= 0; i-- )
		printf("%c",a[i]);
	printf("\n");
}
int main ()
{
	int n , i , j;
	i = 0;
	char a[9] , ch;
	while ((ch = cin.get()) != '\n' )
	{
		a[i] = ch ;
		i = i + 1;
	}
	i = i - 1;
	while (i >= 0)
	{
		cout << a[i] ;
		i = i - 1;
	}
	cout << endl ;
	return 0;
}
int main()
{
	int num,temp,ge,shi,bai,qian;
	cin>>num;
	temp=num;
	if(num==10000) cout<<"00001"<<endl;
	else if(num==0) cout<<"0"<<endl;
	else{
		qian=temp/1000;
	    temp=temp-qian*1000;
	    bai=temp/100;
	    temp=temp-bai*100;
	    shi=temp/10;
	    ge=temp-shi*10;
		if(num>=1&&num<=9) cout<<ge<<endl;
		else if(num>=10&&num<=99) cout<<ge<<shi<<endl;
		else if(num>=100&&num<=999) cout<<ge<<shi<<bai<<endl;
		else cout<<ge<<shi<<bai<<qian<<endl;
	}
	return 0;
}
int main()
{
     int a,b,c,d,e;
     scanf("%d",&a);
     if
     ((a>=1000)&&(a<9999))
    { b=a/1000;
     c=(a%1000)/100;
     d=(a%100)/10; 
     e=a%10;
     printf("%d%d%d%d",e,d,c,b);
     }
     if
                                 ((a>=100)&&(a<999))
     {b=a/100;
     c=(a%100)/10;
     d=a%10;
     printf("%d%d%d",d,c,b);
     }
     if
    
                             ((a>=10)&&(a<99))
     { b=a/10;
     c=a%10;
     printf("%d%d",c,b);
     }
     if
     ((a>=1)&&(a<9))
     printf("%d",a);
     if(a==0)
     printf("0");
     if(a==10000)
     printf("00001");
     }
void main()
{
	int n,i,a;
	scanf("%d", &n);
	int num[5];
	a=100000;
	for(i=0;i<=4;i++)
	{
		a=a/10;
		num[i]=(n/a)%10;
	}
	if(num[0]!=0)
	{
		printf("%d%d%d%d%d",num[4],num[3],num[2],num[1],num[0]);
	}
	else if(num[1]!=0)
	{
		printf("%d%d%d%d",num[4],num[3],num[2],num[1]);
	}
	else if(num[2]!=0)
	{
		printf("%d%d%d",num[4],num[3],num[2]);
	}
	else if(num[3]!=0)
	{
		printf("%d%d",num[4],num[3]);
	}
	else printf ("%d",num[4]);
}
void main()
{
	int a,b,c,d,e,f;
	scanf("%d",&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;
	f=(a-b-10*c-100*d-1000*e)/10000%10;
	if(a>=0&&a<10)
	    printf("%d",b);
	if(a>=10&&a<100)
		printf("%d%d",b,c);
	if(a>=100&&a<1000)
		printf("%d%d%d",b,c,d);
	if(a>=1000&&a<10000)
		printf("%d%d%d%d",b,c,d,e);
	if(a>=10000)
		printf("%d%d%d%d%d",b,c,d,e,f);
	return 0;
}
int main()
{
	int a;
	scanf("%d",&a);
	if(a==a%10)
		printf("%d",a);
	else if(a==a%100)
	printf("%02d",a=(a%100-a%10)/10+(a%10)*10);
    else if(a==a%1000)
    printf("%03d",a=(a%1000-a%100)/100+(a%100-a%10)+(a%10)*100);
	else
	printf("%04d",a=(a%10000-a%1000)/1000+(a%1000-a%100)/10+(a%100-a%10)*10+(a%10)*1000);
	return 0;
}
int main(int argc, char* argv[])
{
 int input;
 int ret,num;
 scanf("%d",&input);

for(;;)
 {
    if(input<10)
   {
    printf("%d\n",input);
break;
   }
   num=input%10;
  input=input/10;
  
  printf("%d",num);

 }

 return 0;
}
int main ()
{
	int n,a,b,c,d;
	scanf("%d",&n);
	a=n/1000;
	b=(n%1000)/100;
	c=(n%100)/10;
    d=n%10;
	if (n<10) printf("%d",d);
	else if(n<100) printf("%d%d",d,c);
	else if(n<1000) printf("%d%d%d",d,c,b);
	else if(n<10000) printf("%d%d%d%d",d,c,b,a);
	return 0;
}
int main()
{
	int i,n,m,a[5];
	cin>>n;
    if(n==0)
		cout<<0;
	else
	{
		{
			for(i=0;n>0;i++)
			{  
				a[i]=n%10;
				n=n/10;
			}
	    }
	m=i;
	for(i=0;i<m;i++)
		cout<<a[i];
	}
	return 0;
}
int main()
{
	int t[5]={1,10,100,1000,10000};
	int x[6];

	int num;
	cin >> num;

	int length;								//length??num???
	length = (num >= t[4]) + (num >= t[3])
		   + (num >= t[2]) + (num >= t[1])
		   + (num >= t[0]);
	for (int i = 1 ; i <= length ; i++)
	{
		x[i] = (num % t[i])/t[i-1];
	}

	if (length == 0)
		cout << "0";
	else
	{
	for (int j = 1 ; j <= length ; j++)
	{
		cout << x[j];
	}
	}
	return 0;
}
int main()
{
	int a,b1,b,c1,c,d1,d,x,y;
	scanf("%d",&x);
	a=x%10;
	b1=x%100;
	b=b1/10;
	c1=x%1000;
	c=c1/100;
	d1=x;
	d=d1/1000;
	if(d!=0)
	{
		y=a*1000+b*100+c*10+d;
		printf("%04d\n",y);
	}
	else if((d==0)&&(c!=0))
	{
		y=a*100+b*10+c;
		printf("%03d\n",y);
	}
	else if((c==0)&&(b!=0))
	{
		y=a*10+b;
		printf("%02d\n",y);
	}
	else
	{
		y=a;
		printf("%d\n",y);
	}
}
int main()
{
    int t,n,a,b,c,d,e,i,j,k,l,m;
    
    scanf("%d",&n);
    t=n;
    j=t/10000;
    if(j!=0)
    {
      i=5;
      t=0;
    }    
    
    j=t/1000;
    if(j!=0)
    {
      i=4;
      t=0;
    }
    
    j=t/100;
    if(j!=0)
    {
      i=3;
      t=0;
    }
    
    j=t/10;
    if(j!=0)
    {
      i=2;
      t=0;
    }

    j=t/1;
    if(j!=0)
    {
      i=1;
      t=0;
    }

    if(n==0)
      printf("%d",0);
    else
    {
      a=n/10000;
      n=n%10000;
      b=n/1000;
      n=n%1000;
      c=n/100;
      n=n%100;
      d=n/10;
      n=n%10;
      e=n;

    
    
    if(i==5) 
      printf("%d%d%d%d%d",e,d,c,b,a);
    if(i==4)
      printf("%d%d%d%d",e,d,c,b);
    if(i==3)
      printf("%d%d%d",e,d,c);
    if(i==2)
      printf("%d%d",e,d);
    if(i==1)
      printf("%d",e);
    }
    return 0;
}
int main()
{
	int num,a,b,c,d,e,p;

	scanf("%d",&num);

    if(num>=10000)
	p=5;
	else if(num>=1000)
	     p=4;
	     else if(num>=100)
	     p=3;
	          else if(num>=10)
	         p=2;
	               else 
	               p=1;
	a=(int)(num/10000);
	b=(int)(num%10000/1000);
	c=(int)(num%1000/100);
	d=(int)(num%100/10);
	e=(int)(num%10);


   switch(p)
	{
	case 5:printf("%d%d%d%d%d",e,d,c,b,a);break;

	case 4:printf("%d%d%d%d",e,d,c,b);break;
	case 3:printf("%d%d%d",e,d,c);break;
	case 2:printf("%d%d",e,d);break;
	case 1:printf("%d",e);break;
	
	}
}
int main()
{
	int t,a,b,c,d,e;
	scanf("%d",&t);
	a=t/10000;
	b=t/1000-10*a;
	c=t/100-100*a-10*b;
	d=t/10-1000*a-100*b-10*c;
	e=t%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(b) printf("%d%d",e,d);
				else
					printf("%d",e);
	return 0;
}
int e(int n)
{
	if(n==0) return 1;
	else
		return 10*e(n-1);
}
int main()
{
	int N;
	int a[4];
	int i=0;
	int t=0;
	int n=0;
	scanf("%d",&N);
	if(N!=0)
	{while(N%(1*e(i))!=N)
		{
		    a[i]=(N%(1*e(i+1))-N%(1*e(i)))/(1*e(i));
		    i++;
		}
	    while(t<=i-1)
		{
		    printf("%d",a[t]);
		    t++;
	}}
	else
		printf("0\n");
	return 0;
}
void main()
{
	int num,a,b,c,d,e;
	scanf("%d",&num);
	a=num/10000;
	b=num%10000/1000;
	c=num%1000/100;
	d=num%100/10;
	e=num%10;
	if (num/10000==1)
		printf("%d%d%d%d%d",e,d,c,b,a);
	else if (num/1000!=0)
		printf("%d%d%d%d",e,d,c,b);
	else if (num/100!=0)
		printf("%d%d%d",e,d,c);
	else if (num/10!=0)
		printf("%d%d",e,d);
	else printf("%d",e);
}
int main()
{
	int number,i,m,x[5];
	scanf("%d",&number);
	if (number<=9) i=1;
	else if(number<=99) i=2;
	else if(number<=999) i=3;
	else if(number<=9999) i=4;
	else i=5;
	for(m=0;m<=i-1;m++)
		{
		x[m]=number%10;
	    number=(number-x[m])/10;
	     }
	for(m=0;m<=i-1;m++)
		printf("%d",x[m]);

	return 0;
	
}
int main()
{
	int a[4],b;
	char cc;
	cin>>b;
	a[0]=b%10;
	b=b/10;
	a[1]=b%10;
	b=b/10;
	a[2]=b%10;
	b=b/10;
	a[3]=b%10;
	b=b/10;
	if(a[3]!=0)
		cout<<a[0]<<a[1]<<a[2]<<a[3];
	else if(a[2]!=0)
		cout<<a[0]<<a[1]<<a[2];
	else if(a[1]!=0)
		cout<<a[0]<<a[1];
	else cout<<a[0];



	return 0;
}
//********************************
//* Name:????                *
//* Authur:sunzeyu               *
//* Editting time:2013.10.19     *
//* Function:????            *
//********************************
int main()
{
	int a[5],n,i,k=0;
	cin>>n;
	for(i=0;i<5;i++)
	{
		a[i]=n%10;
		n=n/10;
	}
	for(i=4;i>=0;i--)
		if(a[i]!=0)
		{
			k=i;
		    break;
		}
	for(i=0;i<=k;i++)
		cout<<a[i];
	cout<<endl;
	return 0;
}
int main()
{
	char c, i = 0;
	char num[7] = {0};
	while((c = cin.get()) != '\n')
	{
		num[i ++] = c;
	}
	for (i = i - 1;i >= 0; i --)
		cout << num[i];
	cout << endl;
	return 0;
}
int main()
{
	int n,a,b,c,d,e,f;
	scanf("%d",&n);
	a=n/10000;
	b=(n-a*10000)/1000;
	c=(n-a*10000-b*1000)/100;
	e=n%10;
	d=(n%100-e)/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()
{
	float a,b,c;
	int d,e,f,g,h,j,k,l,m,i,n;
	char p[10];
	scanf("%s",p);
	for (i=strlen(p)-1;i>=0;i--)
		printf("%c",p[i]);
	return 7;
}
int main()
{
	int n,i,j,k;
		scanf("%d",&n);
	    i=(n%10)*10+(n-n%10)/10;
		j=(n%10)*100+(n%100-n%10)+(n-n%100)/100;
		k=(n%10)*1000+(n%100-n%10)*10+(n%1000-n%100)/10+(n-n%1000)/1000;
		if(n%10==n)
			printf("%d",n);
		else if(n%100==n)
			printf("%02d",i);
		else if(n%1000==n)
			printf("%03d",j);
		else 
			printf("%04d",k);
		return 0;
}
int main()
{
  int n,a,b,c,d;	
	scanf("%d",&n);
	a=n/1000;
	b=(n/100)%10;
	c=(n%100)/10;
	d=n%10;

    
	
	if(n/1000!=0) printf("%d%d%d%d",d,c,b,a);
	else if(n/100!=0) printf("%d%d%d",d,c,b);
	else if(n/10!=0) printf("%d%d",d,c);
	else printf("%d",d);
	
	
return 0;

}
//*************************
// 5.9.cpp
// ??  1200018415
// 2012  10 25
//***********************


int main()
{
	int n, a, b, c,d;
	cin >> n;
	a = n / 1000;                         // ????
	b = n / 100-a * 10;                   // ????
	c = n / 10 - a * 100 -b * 10;         // ????
	d = n % 10;                           // ????
	cout << d;                            // ?????
	if (a != 0 || b != 0 || c != 0)       // ???????
		cout << c;                        // ?????
	if (a != 0 || b != 0)                 // ???3?4??
		cout << b;                        // ?????
	if ( a != 0)                          // ???4??
		cout << a;                        // ?????
	return 0;

}
int main()
{
	int x,a,b,c,d,e,n;
	scanf("%d",&x);
	if(x==0)
		printf("0");
	n=(int)log10((double)x);
	a=x/10000;
	x=x-a*10000;
	b=x/1000;
	x=x-b*1000;
	c=x/100;
	x=x-c*100;
	d=x/10;
	e=x-d*10;

	switch(n)
	{
		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);
	}

	return 0;
}
int main()
{
	int t,a[10],m,i;
	scanf("%d",&t);
    for(i=0;i<=4;i++)
	{
		a[i]=t%10;
		t=t/10;
	}
	for(i=4;i>=0;i--)
	{
        if(a[i]!=0)
		{
			m=i;break;
		}
	}
	for(i=0;i<=m;i++)
	{
		printf("%d",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%1000)/100;
	d=(n%100)/10;
	e=n%10;
	if(a!=0)
		printf("00001\n");
	else if(b!=0)
	{if(e!=0)
	printf("%d\n",e*1000+d*100+c*10+b);
	else if(d!=0)
		printf("0%d\n",d*100+c*10+b);
	else if(c!=0)
		printf("00%d\n",c*10+b);
	else
		printf("000%d\n",b);
	}
	else if(c!=0)
	{if(e!=0)
	printf("%d\n",e*100+d*10+c);
	else if(d!=0)
		printf("0%d\n",d*10+c);
	else
		printf("00%d\n",c);
	}
	else if(d!=0)
	{if(e!=0)
	printf("%d\n",e*10+d);
	else 
		printf("0%d\n",d);
	}
	else
		printf("%d\n",n);
	return 0;
}
int main()
{
    int n,a,b,c,d,e;
    scanf("%d",&n);
    if(n==100)
	{printf("001");}
    else if(n>=1&&n<=9)
	{  printf("%d",n);}
	else if(n>=10&&n<=99)
	{  a=n%10;
	   b=n/10;
	   c=a*10+b;
	   d=e=0;
	   printf("%d",c);
	}
	else if(n>100&&n<=999)
	{   a=n%100;
	    b=a%10;
		c=a/10;
		d=n/100;
        e=b*100+c*10+d;
		printf("%d",e);
	}
    else if (n>=1000&&n<=9999)
	{
		a=n%10;
		b=(n%100-a)/10;
		c=n%1000/100;
		d=n/1000;
		e=a*1000+b*100+c*10+d;
		printf("%d",e);
	}
	else 
	{ printf("error");}
	return 0;
}
void main()
{
  int a,b,c,d,x;
  scanf("%d",&x);
  if(x==0)  printf("0");
  else if(x<=9)  printf("%d",x);
  else if(x<=99)
    {
      a=x%10;
	  b=(x-a)/10;
	  printf("%d%d",a,b);
    }
  else if(x<=999)
   {
     a=x%10;
	 b=((x-a)%100)/10;
	 c=(x-10*b-a)/100;
	 printf("%d%d%d",a,b,c);
   }
  else if(x<=9999)
  {
    a=x%10;
	b=((x-a)%100)/10;
	c=((x-10*b-a)/100)%10;
	d=(x-100*c-10*b-a)/1000;
	printf("%d%d%d%d",a,b,c,d);
  }
  else printf("00001");
  printf("\n");
}
int main()
{
    int m,n,i,j=0,k=1,a[5]={0},t;
    scanf("%d",&m);
    for(i=1;i<=10000;i=i*10)
    {
                            if(m/i!=0)
                            j++;
                            else 
                            break;
    }
    for(i=1;i<j;i++)
    {
                    k=10*k;
    }
    for(i=j;i>=1;i--)
    {
                     a[i]=m/k;
                     m=m%k;
                     k=k/10;
    }
    for(i=1;i<=j;i++)
    {
                    printf("%d",a[i]);
    }
    getchar();
    getchar();
    getchar(); 
}
int main()
{
	int a[4];
	int n;
	cin>>n;
	a[0]=n/1000;
	a[1]=(n-a[0]*1000)/100;
	a[2]=(n-a[0]*1000-a[1]*100)/10;
	a[3]=n%10;
	if (a[0]==0)
	{
		if (a[1]==0)
		{
			if (a[2]==0)
				cout<<a[3]<<endl;
			else cout<<a[3]<<a[2]<<endl;
		}
		else cout<<a[3]<<a[2]<<a[1]<<endl;
	}
	else cout<<a[3]<<a[2]<<a[1]<<a[0]<<endl;

return 0;

}
int main()
{
	int z,a,b,c,d,e;
	scanf("%d",&z);
	a=(int)z/10000;
	z=z-a*10000;
	b=(int)z/1000;
	z=z-b*1000;
	c=(int)z/100;
	z=z-c*100;
	d=(int)z/10;
	e=z-d*10;
	if(a==0)
		if(b==0)
			if(c==0)
				if(d==0)
					printf("%d",e);
				else
					printf("%d%d",e,d);
			else
				printf("%d%d%d",e,d,c);
		else
			printf("%d%d%d%d",e,d,c,b);
	else
		printf("%d%d%d%d%d",e,d,c,b,a);
	return 0;
}
int main()
{
    int a, b, c, d, e, n;
    scanf("%d",&n);
    a=(int)(n/10000);
    b=(int)(n/1000-a*10);
    c=(int)(n/100-a*100-b*10);
    d=(int)(n/10-a*1000-b*100-c*10);
    e=(int)(n-a*10000-b*1000-c*100-d*10);
    if(a!=0)
        printf("%d%d%d%d%d\n",e,d,c,b,a);
    if(a==0&&b!=0)
        printf("%d%d%d%d\n",e,d,c,b);
    if(a==0&&b==0&&c!=0)
        printf("%d%d%d\n",e,d,c);
    if(a==0&&b==0&&c==0&&d!=0)
        printf("%d%d\n",e,d);
    if(a==0&&b==0&&c==0&&d==0)
        printf("%d\n",e);
    return 0;
}
int main()
{
	int a;
	int b,c,d,e;
	scanf("%d",&a);
	b=a/1000;
	c=a%1000;
	d=c%100;
	e=d%10;
	c=c/100;
	d=d/10;
	printf("%d",e);
	if(d!=0,(b+c+d)!=0)
		printf("%d",d);
	if(c!=0,(b+c)!=0)
		printf("%d",c);
	if(b!=0)
		printf("%d",b);
}
int main()
{
	int n,a,b,c,d,e;
	scanf("%d",&n);
	while(n!=0)
	{
	a=n%10;
	printf("%d",a);
	n=n/10;
	}
	return 0;
}
int main()
{
	int a,b,c,d,e,n,m;
	scanf("%d",&n);
	a=n/10000;
	b=n/1000;
	c=n/100;
	d=n/10;
	e=n/1;
	if(a>0)
	{
		printf("00001");
	}
	else if(b>0)
	{
		c=(n-b*1000)/100;
		d=(n-b*1000-c*100)/10;
		e=n-b*1000-c*100-d*10;
		printf("%d%d%d%d",e,d,c,b);
	}
	else if(c>0)
	{
		d=(n-c*100)/10;
		e=n-b*1000-c*100-d*10;
		printf("%d%d%d",e,d,c);
	}
	else if(d>0)
	{
		e=n-d*10;
		printf("%d%d",e,d);
	}
	else 
	{
		printf("%d",e);
	}
	return 0;
}
int main()
{
    int x,a,b,c,d;
    scanf("%d",&x);
    if(x==10000)
    printf("00001");
    else if(x<10000&&x>=1000)
    {
    a=x%10;
    b=((x-a)/10)%10;
    c=((x-a-10*b)/100)%10;
    d=(x-a-10*b-100*c)/1000;
    printf("%d%d%d%d",a,b,c,d);
    }
    else if(x<1000&&x>=100)
    { 
    a=x%10;
    b=((x-a)/10)%10;
    c=(x-a-10*b)/100;
    printf("%d%d%d",a,b,c);
    }
    else if(x<100&&x>=10)
    { 
    a=x%10;
    b=(x-a)/10;
    printf("%d%d",a,b);
    }
    else printf("%d",x);
    return 0;
}
int main()
{
	int n,a,b,c,d,e,f,g,h,i,j;
	scanf("%d",&n);
	a=n%10;
	e=n-a;
	f=e/10;
         b=f%10;
	g=n-10*b-a;
	h=g/100;
	c=h%10;
         i=n-100*c-10*b-a;
	j=i/1000;
	d=j%10;
	if(d==0)
	{
		if(c==0)
		{
			if(b==0)
				printf("%d",a);
			else
				printf("%d%d",a,b);
		}
		else
			printf("%d%d%d",a,b,c);
	}
	else
		printf("%d%d%d%d",a,b,c,d);
	return 0;
}
int main()
{
 int num;
 scanf("%d",&num);
 if(num==10000)
 printf("00001\n");
 else
 if(num>999)
 printf("%d%d%d%d\n",num%10,num%100/10,num/100%10,num/1000%10);
 else
 if(num>99)
 printf("%d%d%d\n",num%10,num%100/10,num/100%10);
 else
 if(num>9)
 printf("%d%d\n",num%10,num%100/10);
 else
 printf("%d\n",num);
 return 0;
}
main()
{
	int a,i;
	scanf("%d",&a);
         if(a==0) printf("%d",a);
	for(i=0;i<5;i++)
	{
		if(a!=0)
			printf("%d",a%10);
		a=a/10;
	}
	printf("\n");
	return(0);
}
void main()
{
	int n,b,c,d,i,t,j;
	c=0;
	scanf("%d",&n);
	if(n>0&&n<10000)
	{
		for(i=4;i>=1;i--)
	{
		b=n%(int)pow(10.0,(double)i)/(int)pow(10.0,(double)(t=i-1));
		if(b!=0)
		{
			j=i;
			break;
		}
	}
	for(i=1;i<=j;i++)
	{
		d=n%(int)pow(10.0,(double)i)/(int)pow(10.0,(double)(t=i-1));
		printf("%d",d);
	}
	}
	else if(n==0)
		printf("0");
		else if(n==10000)
			printf("00001");
}
int main ()
{
	int a,b,c,d,e,z,y;
	scanf("%d",&a);
	if(a<10)
		printf("%d",a);
	else if(a<100)
	{
		b=a/10;
		c=a%10;
		printf("%d%d",c,b);
	}
	else if(a<1000)
	{
		b=a/100;
		z=a%100;
		c=z/10;
		d=z%10;
		printf("%d%d%d",d,c,b);
	}
	else if(a<10000)
	{
		b=a/1000;
		z=a%1000;
		c=z/100;
		y=z%100;
		d=y/10;
		e=y%10;
		printf("%d%d%d%d",e,d,c,b);
	}
	else
		printf("00001");
	return 0;
}
int main()
{
  int a[10];
  int n,i,j;
  scanf("%d",&n);
  if (n==0) {printf("0\n");return 0;}
  for(i=1;n>0;i++)
   {
    a[i]=n%10;
    n=n/10;
   }
   for(j=1;j<=i-1;j++)
   printf("%d",a[j]);
//   scanf("%d",&n);
   return 0;
}
int main()
{
  int a,b,c,d,n;
  scanf("%d",&n);
  if(n==10000)
  {puts("00001");}
  else if(n>=1000)
  {a=n/1000,b=n/100-a*10,c=n/10-a*100-b*10,d=n-1000*a-100*b-10*c;
  printf("%d%d%d%d",d,c,b,a);}
  else if(n>=100)
  {a=n/100,b=n/10-a*10,c=n-a*100-b*10;
  printf("%d%d%d",c,b,a);}
  else if(n>=10)
  {a=n/10,b=n-10*a;
  printf("%d%d",b,a);}
  else printf("%d",n);
}
int main()
{
	int n,a,b,c;
	cin>>n;
	if(n<10)
		cout<<n;
	else if(n<100)
		cout<<n%10<<n/10;
	else if(n<1000)
		{
			a=n%10;
	  n=(n-a)/10;
	  b=n%10;
	  n=(n-b)/10;
	  cout<<a<<b<<n;
	}
	else if(n<10000)
	{	a=n%10;
	     n=(n-a)/10;
	  b=n%10;
	  n=(n-b)/10;
	  c=n%10;
	  n=(n-c)/10;
	  cout<<a<<b<<c<<n;}
	else 
		cout<<"0"<<"0"<<"0"<<"0"<<"1";
	return 0;
}
int main()
{
	int a,b,c;
	cin>>a;
	for(int i=1;;i++)
	{
		b=a%10;
		cout<<b;
		c=a/10;
		if(c==0)
			break;
		a=c;
	}
}
int main()
{
 int a,b,c,d,e;
 scanf("%d",&a);
if(a==0) printf("0");
else
{
b=a/1000;
 c=(a%1000)/100;
 d=(a%100)/10;
 e=a%10;
 a=b+10*c+100*d+1000*e;
 if((a%10)==0) 
  {
   a=a/10;
   if((a%10)==0) 
    {
     a=a/10;
      if((a%10)==0) a=a/10;
    }
   }
if(e==0) 
{
   printf("%d",e);
   if(d==0)
    { 
      printf("%d",d);
      if(c==0) 
     printf("%d",c);
      }
} 
 printf("%d",a);
}
 return 0;
}
int main()
{
	 int n,a,b,c,d;
     scanf("%d",&n);
	 if(n<10)
		 printf("%d",n);
	 if(n>10&&n<100)
	 {	 a=n%10;
	     b=n/10;
		 n=10*a+b;
	 printf("%d",n);}
	 if(n>100&&n<1000)
	 {
		 a=n%10;
		 b=(n%100-a)/10;
		 c=n/100;
		 n=100*a+10*b+c;
		 printf("%d",n);
	 }
	 if(n>1000&&n<10000)
	 {
		 a=n%10;
		 b=(n%100-a)/10;
		 c=(n%1000-10*b-a)/100;
		 d=n/1000;
		 n=1000*a+100*b+10*c+d;
		 printf("%d",n);
	 }
         if(n==10) printf("01");
         if(n==100) printf("001");
         if(n==1000) printf("0001");
         if(n==10000) printf("00001");
		
	return 0;
}
int main()
{
	int x,y,a,b,c,d,e;
	scanf("%d",&x);
	a=x/10000;
	x=x%10000;
	b=x/1000;
	x=x%1000;
	c=x/100;
	x=x%100;
	d=x/10;
	x=x%10;
	e=x;
	if (a==0)
	{
		if(b==0)
		{
			if(c==0)
			{
				if(d==0)
				{
					y=e;
					printf("%d",y);
				}
				else
				{
					y=10*e+d;
					if(e==0)
						printf("0%d",y);
					else
						printf("%d",y);
				}

			}
			else
			{
				y=100*e+10*d+c;
				if(e==0)
				{
					if(d==0)
						printf("00%d",y);
					else
						printf("0%d",y);
				}
				else
					printf("%d",y);
			}

		}
		else
		{
			y=1000*e+100*d+10*c+b;
			if(e==0)
			{
				if(d==0)
				{
					if(c==0)
						printf("000%d",y);
					else
						printf("00%d",y);
				}
				else
					printf("0%d",y);
			}
			else
				printf("%d",y);
		}

	}
	else
	{
		y=10000*e+1000*d+100*c+10*b+a;
		if(e==0)
		{
			if(d==0)
			{
				if(c==0)
				{
					if(b==0)
						printf("0000%d",y);
					else
						printf("000%d",y);
				}
				else
					printf("00%d",y);
			}
			else
				printf("0%d",y);
		}
		else
			printf("%d",y);
	}

	return 0;
}
int main()
{
    int i,l;
    char s[4],r[4];
    scanf("%s",s);
    l=strlen(s);
    for(i=0;i<l;i++)
    {
      r[i]=s[l-1-i];
    }
    for(i=0;i<l;i++)
    printf("%c",r[i]);
    getchar();
    getchar();
}
int main()
{
	int n,i;
	scanf("%d",&n);
	if(n/10000!=0)
	printf("00001");
	else if(n/1000!=0)
	{
		int a,b,c,d;
		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!=0)
	{
		int e,f,g;
		e=n/100;
		f=(n-100*e)/10;
		g=n%10;
		printf("%d%d%d",g,f,e);
	}
	else if(n/10!=0)
	{
		int p,q;
		p=n/10;
		q=n%10;
		printf("%d%d",q,p);
	}
	else
	printf("%d",n);
	return 0;
	
}
int main()
{
	int a,b,c,d,e,f,g,h,i;
	scanf("%d",&a);
	b=a%10;
	c=a/10;
	d=((a-b)%100)/10;
	e=a/100;
	f=((a-b-d*10)%1000)/100;
	g=a/1000;
	h=((a-b-d*10-f*100)%10000)/1000;
	i=a/10000;
	if(c<1){
		printf("%d\n",a);
	}
	else{
		if(e<1){
			printf("%d%d\n",b,d);
		}
		else{
			if(g<1){
				printf("%d%d%d\n",b,d,f);
			}
			else{
				printf("%d%d%d%d\n",b,d,f,h);
			}
		}
	}
}
int main()
{
int a,b,c,d;
scanf("%d",&a);
if (a==10000)
printf("00001");
else
if (a>=1000)
{
	b=a%10;
a=(a-b)/10;
c=a%10;
a=(a-c)/10;
d=a%10;
a=(a-d)/10;
printf("%d%d%d%d",b,c,d,a);}
else
    if(a>=100)
	{b=a%10;
a=(a-b)/10;
c=a%10;
a=(a-c)/10;
printf("%d%d%d",b,c,a);}
    else
      if(a>=10)
	  {b=a%10;
a=(a-b)/10;
printf("%d%d",b,a);}
else
printf ("%d",a);
return 0;
}
main()
{
  char a[6];
  gets(a);
  int i,j;
  j=strlen(a);
  for(i=j-1;i>=0;i--)
  printf("%c",a[i]) ;
  getchar();
  getchar();    
}
int 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-10000*b-1000*c-100*d-10*e;
	if(b==1)
	{
	printf("%d%d%d%d%d%d",f,e,d,c,b);
	}
	else
	{
		if(c>=1)
		{printf("%d%d%d%d",f,e,d,c);
		}
		else
		{
			if(d>=1)
			{
				printf("%d%d%d",f,e,d);
			}
			else
			{
				if(e>=1)
				{
					printf("%d%d",f,e);
				}
				else
				{
					printf("%d",f);
				}
			}
		}
	}
	return 0;
}
main()
{   int a;
	scanf("%d",&a);
	if(a<10)
	printf("%d",a);
	else if(a<100)
	{ int b,c; b=a/10; c=a-10*b;
	printf("%d%d",c,b);}
	else if(a<1000)
	{ int b,c,d; b=a/100;c=(a-100*b)/10;d=a-100*b-10*c;
	printf("%d%d%d",d,c,b);}
	else if(a<10000)
	{ int b,c,d,e;b=a/1000;c=(a-1000*b)/100;d=(a-1000*b-100*c)/10;
	e=a-1000*b-100*c-10*d;
	printf("%d%d%d%d",e,d,c,b);}
		
}
int main()
{
int n,a,b;
double i;
cin>>n;
if(n<10)
cout<<n;
else if(n>=10&&n<100)
{
	for(i=1;i<=2;i++)
{
	a=n%(int)pow(10,i);
	b=a/(pow(10,i-1));
	n-=a;
	cout<<b;
}
}

else
{
	for(i=1;i<=3;i++)
{
	a=n%(int)pow(10,i);
	b=a/(pow(10,i-1));
	n-=a;
	cout<<b;
}
a=n%(int)pow(10,i);
	b=a/(pow(10,i-1));
	n-=a;
	if(b!=0)
		cout<<b;
}
return 0;
}