semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void main()
{
unsigned long intonumber(char x);
char intochar(int y);
char str[N];
char former[3];
gets(str);
int i=0,c1=0,c2=0;
while(str[i]!=' ')
{
	former[i]=intonumber(str[i]);
	c2=c1+former[i];
	c1=c2*10;
	i++;
}
i++;
int j=0;
unsigned long n2=0,n1=0;char num[N];
while(str[i]!=' ')
{
	num[j]=intonumber(str[i]);
	n2=n1+num[j];
	n1=n2*c2;
	j++;i++;

}
i++;int k=0,l1=0,l2=0;char later[3];
while(str[i]!='\0')
{
later[k]=intonumber(str[i]);
l2=l1+later[k];
l1=l2*10;
i++;k++;

}


int f;char yu[M];
for(f=0;n2>0;f++)
{
	yu[f]=intochar(n2%l2);
	n2=n2/l2;
}

if(f==0)printf("%d",0);
for(f--;f>=0;f--)
printf("%c",yu[f]);
}



unsigned long intonumber(char x)
{
	if(x>='a'&&x<='z')
		x=x-87;
	else if(x>='A'&&x<='Z')
		x=x-55;
	else if(x>=48&&x<=57)
		x=x-48;
	return(x);
}

char intochar(int y)
{
	if(y>=0&&y<=9)
		y=y+48;
	else if(y>9&&y<=32)
		y=y+55;
	return(y);

}
main()
{
      int a,b,i,sum=0,m,k,l;
      char c[40];
      scanf("%d %s %d",&a,c,&b);
      m=strlen (c);
                for(i=0;i<m;i++)
      {
                if (c[i]>='a')
                c[i]=c[i]+'A'-'a';
                if(c[i]>='A')
                sum=(c[i]+10-'A')+sum*a;
                else if(c[i]<='9')
                sum=(c[i]-'0')+sum*a;          
      }
      
      
      char d[40]={0};
      l=sum;
      for(i=0;;i++)
      {
      k=l%b;
      l=l/b;
      if(k<=9)
      d[i]=k+'0';
      else
      d[i]=k-10+'A';
      
      m=i+1;
      if (l==0) break;
      }
      
      char e[m];
      for(i=0;i<=m-1;i++)
      {
      e[m-1-i]=d[i];
      }
      e[m]='\0';
      puts(e);
   
      
}
int main()
{int a,b,num;
int i=1,j=1,k=1,count=0;
long sum=0;
long sum1;
char n[100];
for(k=0;k<100;k++)
{n[k]='\0';                  
                  }
cin>>a>>n>>b;
for(count=0;count<100;count++)
{if(n[count]=='\0')
{num=count;
break;
}
}
     int shu[num];
for(i=0;i<num;i++)  
{shu[i]=n[i];
if(shu[i]<58)
shu[i]=shu[i]-48;
else if(shu[i]<91)
shu[i]=shu[i]-55;
else
shu[i]=shu[i]-87;
                     }  
for(i=0;i<num;i++)
{
                  sum=sum+shu[i]*(long)pow((double)a,(double)(num-i-1));
                   }
                   sum1=sum;
for(i=1;i<100;i++)
{sum1=sum1/b;
if(sum1==0)
{break;}                  
                  }
long shu1[i];   
for(j=0;j<i;j++)
{shu1[j]=sum%b;
sum=sum/b;
}
char m[i];
for(j=0;j<i;j++)
{if(shu1[i-j-1]<10)
m[j]=shu1[i-j-1]+48;
else
m[j]=shu1[i-j-1]+55;
cout<<m[j];
}
return 0;
    }
main()
{
int x,y;int rest;int r,s,t;
char NUM[150];
scanf("%d %s %d",&x,NUM,&y);
int LEN;
LEN=strlen(NUM);
int i,j,k;int m=0,n=0;
char a='a',A='A',Z='Z',z='z';
char zero='0',nine='9';
for (i=0;i<LEN;i++)
{
if (NUM[i]>=a&&NUM[i]<=z)
NUM[i]=NUM[i]-a+10;
if (NUM[i]>=A&&NUM[i]<=Z)
NUM[i]=NUM[i]-A+10;
if (NUM[i]>=zero&&NUM[i]<=nine)
NUM[i]=NUM[i]-zero;
}
for (i=0;i<LEN;i++)
{
m=NUM[i];
for (j=1;j<=LEN-i-1;j++)
m*=x;
n+=m;
}
rest=n;
for (i=0;;i++)
{
if (rest==0) break;
rest/=y;
}
int PUT[1000];
int kk=i;
for (;kk>=1;kk--)
{
r=n%y;
n/=y;
PUT[kk-1]=r;
}
if (i==0) printf("0");
else for (j=0;j<i;j++)
{
if (PUT[j]>=10)
printf("%c",PUT[j]-10+A);
else 
printf("%d",PUT[j]);
}
printf("\n");
}
int main ( )
{
	int n1,n2,l,t;long s=0;char number1[40],number2[40],*p;
	scanf("%d %s %d",&n1,number1,&n2);
	l=strlen(number1);
	for(p=number1;p<number1+l;p++)
	{
		if(*p>='0'&&*p<='9')
			t=*p-'0';
		else if(*p>='a'&&*p<='z')
			t=*p-'a'+10;
		else if(*p>='A'&&*p<='Z')
			t=*p-'A'+10;
		s=s*n1+t;
	}
	for(p=number2;1;p++)
	{
		if(s%n2>=0&&s%n2<=9)
			*p=s%n2+48;
		else if(s%n2>9)
			*p=s%n2+55;
		s=s/n2;
		if(s==0)
			break;
	}
	for(;p>=number2;p--)
		printf("%c",*p);
	printf("\n");
	return 0;
}
int main()
{
  int a,b,num[100],top=0;//???????a?b
  char s[100];//???????s
  cin>>a;//??????
  cin>>s;
  cin>>b;
  int i;
  for(i=0;s[i]!='\0';i++){
   if((s[i]>=65)&&(s[i]<=90))//??????????????? 
    num[i]=s[i]-'A'+10;
   else if((s[i]>=90)&&(s[i]<=122))//?????????????
    num[i]=s[i]-'a'+10;
   else if((s[i]>='0')&&(s[i]<='9'))//???????????
    num[i]=s[i]-'0';
   top++;
  }
 long int sum=0;//??sum
  for(i=0;i<top;i++)//?sum????
     sum=sum*a+num[i];
char s1[10000];//???????
  int j;//??j
  if(sum==0)  cout<<"0"<<endl;//??sum??????0
  else/* ????????   */
  {for(j=0;sum;j++){
  if((sum%b)>9)   s1[j]=(char)((sum%b)-10+'A');
  else s1[j]=(char)((sum%b)+'0');
  sum=sum/b;
 
 
  }
  for(j=j-1;j>=0;j--){
  cout<<s1[j];
 
  }
 
 
  
  cout<<endl;}
 return 0;//?????
}
void main ()
{
	int a,b,i,l;
	long m=1,num=0;
	char n[32],str[32]={0};
	scanf("%d%s%d",&a,n,&b);
	l=strlen(n);
	for(i=0;i<l;i++)
	{
		if((n[i]>='a')&&(n[i]<='z'))n[i]-=87;
        if((n[i]>='A')&&(n[i]<='Z'))n[i]-=55;
        if((n[i]>='0')&&(n[i]<='9'))n[i]-=48;
	}
	for(i=l-1;i>=0;i--)
	{
		//if(m==1){num+=n[i];m=m*a;}
		num+=m*n[i];
		m=m*a;
	}
	m=1;
	for(i=31;i>=0;i--)
	{
		str[i]=num%b;
		num=num/b;
		if(num==0)break;
	}
	for(l=i;l<32;l++)
	{
		if((str[l]>=0)&&(str[l]<=9))printf("%d",str[l]);
        if(str[l]>=10)printf("%c",str[l]+55);
	}
	printf("\n");
}
void main()
{
    int a,b,i,n,k,p[100];
    long int m=0,j,q;
    char in[100],t,out[100];
    scanf("%d",&a);
    for(i=0;i<=29;i++)
    {
        t=getchar();
        n=i;
        if(t==32)
        {
            if(i!=0)
            {
                break;
            }
        }
        else
        {
            in[i-1]=t;
        }
    }
    scanf("%d",&b);
    for(i=0;i<=n-2;i++)
    {
        if(in[i]>47&&in[i]<58)
        {
            j=in[i]-48;
        }
        if(in[i]>64&&in[i]<91)
        {
            j=in[i]-55;
        }
        if(in[i]>96&&in[i]<123)
        {
            j=in[i]-87;
        }
        for(k=1+i;k<=n-2;k++)
        {
            j=j*a;
        }
        m=m+j;
        q=m;
    }
    for(i=1;i<=500;i++)
    {
        m=m/b;
        n=i;
        if(m==0)
        {
            break;
        }
    }
    for(i=0;i<=n-1;i++)
    {
        p[n-1-i]=(q%b);
        q=q/b;
    }
    for(i=0;i<=n-1;i++)
    {
        if(p[i]>=0&&p[i]<=9)
        {
            out[i]=p[i]+48;
        }
        if(p[i]>=10&&p[i]<=35)
        {
            out[i]=p[i]+55;
        }
    }
    for(i=0;i<=n-1;i++)
    {
        printf("%c",out[i]);
    }
}
main()
{
    long int f(int y,int r);
    int a,b,i,j,t=0;
    long int q=0,w=0,p=0;
    char n[800];
    int m[1000];
      scanf("%d",&a);
      scanf("%s",n);
      scanf("%d",&b);
     if(n[0]=='0')
     printf("%c",'0');
    else
     {
            p=strlen(n);
           for(i=0;i<p;i++)
           {
               if(n[i]>='A'&&n[i]<='Z') 
                   n[i]=n[i]-'A'+10;
               else if(n[i]>='a'&&n[i]<='z') 
                    n[i]=n[i]-'a'+10;
                    else if(n[i]>='0'&&n[i]<='9')
                    n[i]=n[i]-'0';
           }
           w=0;
           for(i=0;i<p;i++)
          { 
          w=w*a+n[i];
          }
           for(j=0;;j++)
            {
            m[j]=w%b;
            w=w/b;
            if(w<b)
            { m[j+1]=w%b; 
                t=j+1;      
             break; 
             }
             } 
            m[t+1]='\0';
          for(i=t;i>=0;i--)
          {
             if(m[i]>9)
             {
                          m[i]=m[i]+'A'-10;
                        printf("%c",m[i]);
             }
               else 
                         printf("%c",m[i]+'0');
                  
          }
          }
            
              getchar();
              getchar();
              
              
                  }
int main()
{long int s,i,a,b,w[1000],q,aa,l;
char n[12000];
	scanf("%d%s%d",&a,&n,&b);
    l=strlen(n);
	aa=1;s=0;
	for (i=l-1;i>=0;i--)

	{
		if(n[i]>=48&&n[i]<=57)s=s+aa*(n[i]-48);
		if(n[i]>='a'&&n[i]<='z')s=s+aa*(n[i]+10-'a');
		if(n[i]>='A'&&n[i]<='Z')s=s+aa*(n[i]+10-'A');
		aa=aa*a;
	}q=0;
if (s==0)printf("0");
	while(s>0)
	{q=q+1;
		w[q]=s%b;
        s=s/b;
	}
	for(i=q;i>=1;i--)
	{if(w[i]<10)printf("%d",w[i]);
	else
		printf("%c",'A'+w[i]-10);
	}
	
	

		
}
void main()
{int a,b,l,i,t=0;
 char n[100],m[100];
 scanf("%d %s %d",&a,n,&b);
 l=strlen(n);
 for(i=0;i<l;i++)
 {t*=a;
  if(n[i]>='0'&&n[i]<='9')
  t+=n[i]-'0';
  else if(n[i]>='a'&&n[i]<='z')
  t+=n[i]-'a'+10;
  else
  t+=n[i]-'A'+10;
 }
 if(t!=0)
 {for(i=0;t!=0;i++)
 {if(t%b>=0&&t%b<=9)
  m[i]=t%b+'0';
  else
  m[i]=t%b-10+'A';
  t=(t-t%b)/b;
 }
 for(t=i-1;t>=0;t--)
	 printf("%c",m[t]);
 printf("\n");
 }
 else
 printf("0\n");
}
int main()
{
	long int b,i=0,j=0,n_number[500],decdec=0,a2[10],k,ans[500],l;
	int mi;
	double a;
	char n[500],ans2[500],a1[10];
	a1[1]=48;
	while((a1[i]=getchar())>=48)   //??a
	{
		i++;
	}
	a2[0]=a1[0]-48;
	a2[1]=a1[1]-48;
	if(a2[1]>=0&&a2[1]<=9) a=a2[0]*10+a2[1];
	else a=a2[0];
	i=0;
	while((n[i]=getchar())>=48) i++;  //??n
    cin>>b;  //??b
	i--;
	for(j=0;j<=i;j++)
	{
		if(n[j]>=48&&n[j]<=57) n_number[j]=n[j]-48;
		else if(n[j]>=65&&n[j]<=90) n_number[j]=n[j]-55;
		else n_number[j]=n[j]-87;
	}
	mi=i;
	for(l=0;l<=i;l++)
	{
		decdec=decdec+n_number[l]*pow(a,mi);
		mi=mi-1;
	}  //??????10??????
	if(decdec==0) cout<<"0";
	else
	{
	k=0;
	while(decdec>0)
	{
		ans[k]=decdec%b;
		decdec=decdec/b;
		k=k+1;
	}  //????????????b??????????
	k--;
	for(j=0;j<=k;j++)
	{
		if(ans[j]>=0&&ans[j]<=9) ans2[j]=ans[j]+48;
		if(ans[j]>=10&&ans[j]<=35) ans2[j]=ans[j]+55;
	}  //???????????????????11?35??
	for(j=k;j>=0;j--)
	{
		cout<<ans2[j];
	}  //??????
	}
	return 0;
}
int main()
{
	int a;
	scanf("%d",&a);
	if(a/10==0)
		printf("%d",a);
	else if(a/100==0)
	{
		int b=a/10;
		int c=a%10;
		printf("%d%d",c,b);
	}
	else if(a/1000==0)
	{
		int b=a/100;
		int c=a%100;
		int d=c/10;
		int e=c%10;
		printf("%d%d%d",e,d,b);
	}
	else if(a/10000==0)
	{
		int b=a/1000;
		int c=a%1000;
		int d=c/100;
		int e=c%100;
		int f=e/10;
		int g=e%10;
		printf("%d%d%d%d",g,f,d,b);
	}
	else
	{
		int b=a/10000;
		int c=a%10000;
		int d=c/1000;
		int e=c%1000;
		int f=e/100;
		int g=e%100;
		int h=g/10;
		int i=g%10;
		printf("%d%d%d%d%d\n",i,h,f,d,b);
	}
	return 0;
}
int main()
{
	int i, x;
	scanf("%d", &x);
	for(i=1; i<=(int)log10(x)+1; i++)
		printf("%d", (x%(int)pow(10,i))/(int)(pow(10,i-1)));
	return 0;
}
int main()
{
    int a1, a2, x;
    int f[4];
    int i, j=5;
    scanf("%d", &a1);
    for(i=1;i<10;i++)
    {
        x=a1-i*10000;
        if(x<0)
		{
        f[0]=i-1;
		break;
		}
		else if(x>=0&&i==9)
			f[0]=9;
    }
    for(i=1;i<10;i++)
    {
        x=a1-f[0]*10000-i*1000;
        if(x<0)
        		{
        f[1]=i-1;
		break;
		}
				else if(x>=0&&i==9)
			f[1]=9;
    }    for(i=1;i<10;i++)
    {
        x=a1-f[0]*10000-f[1]*1000-i*100;
        if(x<0)
        		{
        f[2]=i-1;
		break;
		}
				else if(x>=0&&i==9)
			f[2]=9;
    }    for(i=1;i<10;i++)
    {
        x=a1-f[0]*10000-f[1]*1000-f[2]*100-i*10;
        if(x<0)
        		{
        f[3]=i-1;
		break;
		}
				else if(x>=0&&i==9)
			f[3]=9;
    }
    for(i=1;i<10;i++)
    {
        x=a1-f[0]*10000-f[1]*1000-f[2]*100-f[3]*10-i;
        if(x<0)
        		{
        f[4]=i-1;
		break;			
		}	else if(x>=0&&i==9)
			f[4]=9;
    }
	for(i=0;i<4;i++)
	{
		if(f[i]==0){
			j=i;}
	}
	switch(j)
	{
	case 0:
	a2=f[4]*1000+f[3]*100+f[2]*10+f[1];
	break;
	case 1:
		a2=f[4]*100+f[3]*10+f[2];
	break;
	case 2:
		a2=f[4]*10+f[3];
	break;
	case 3:
		a2=f[4];
	break;
	case 5:
		a2=f[4]*10000+f[3]*1000+f[2]*100+f[1]*10+f[0];
	}
		printf("%d", a2);
    return 0;
}
int main()
{
   int a,b=0,c=0;

   cin>>a;
   b=a%10;
   a=a/10;
   for(;b!=0;)
   { 
       c=c*10+b;
       b=a%10;
       a=a/10;
      
    }
   cout<<c;
    return 0;
}
int main()
{
	int wan,ge,shi,bai,qian;
	long int zheng;
	scanf("%d",&zheng);
	wan=zheng/10000;
	qian=zheng/1000-wan*10;
	bai=zheng/100-wan*100-qian*10;
	shi=zheng/10-wan*1000-qian*100-bai*10;
	ge=zheng-wan*10000-qian*1000-bai*100-shi*10;
	if(wan)
		printf("%d",wan+qian*10+bai*100+shi*1000+ge*10000);
		else
		if(qian)
				printf("%d",qian+bai*10+shi*100+ge*1000);
		else
			if(bai)
				printf("%d",bai+shi*10+ge*100);
			else
				if(shi)
					printf("%d",shi+ge*10);
				else
					printf("%d",ge);


	
}
void main()
{
	int n,i=0,j=0;
	int a[5];
	scanf("%d",&n);
	while(n!=0)
	{
		a[i]=n%10;
		n=n/10;
		i=i+1;
	}
	while(j<i)
	{
		n=10*n+a[j];
		j=j+1;
	}
	printf("%d",n);
}
void main()
{
	int x,a,b,c,d,e;
	scanf("%d",&x);
	if(x<10)
		printf("%d\n",x);
	else if(x<100)
		printf("%d%d\n",x%10,x/10);
	else if(x<1000)
	{
		a=x%10;
		b=(x/10)%10;
		c=x/100;
		printf("%d%d%d\n",a,b,c);
	}
	else if(x<10000)
	{
		a=x%10;
		b=(x/10)%10;
		c=(x/100)%10;
		d=x/1000;
		printf("%d%d%d%d",a,b,c,d);
	}
	else
	{
		a=x%10;
		b=(x/10)%10;
		c=(x/100)%10;
		d=(x/1000)%10;
		e=x/10000;
		printf("%d%d%d%d%d\n",a,b,c,d,e);
	}
}
void main()
{
	int a[5],n,i;
	scanf("%d",&n);
	for (i=1;i<=5;i++)
	{	a[i]=n%10;
	  n=(n-a[i])/10;
	}
for (i=1;i<=5;i++)
if (a[i]!=0) printf("%d",a[i]);
}
void main ()
{    int n,a,b,c,d,e,f;
     scanf("%d",&n);
     if(n/10000!=0)
     {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;
      f=e*10000+d*1000+c*100+b*10+a;}
     else if(n/10000==0&&n/1000!=0)
     {a=n/1000;
      b=(n-a*1000)/100;
      c=(n-a*1000-b*100)/10;
      d=n-a*1000-b*100-c*10;
      f=d*1000+c*100+b*10+a;}
      else if(n/10000==0&&n/1000==0&&n/100!=0)
      {a=n/100;
      b=(n-a*100)/10;
      c=n-a*100-b*10;
      f=c*100+b*10+a;}
      else if(n/10000==0&&n/1000==0&&n/100==0&&n/10!=0)
      {a=n/10;
      b=n-a*10;
       f=b*10+a;}
       else{f=n;}
      printf("%d",f);
}
int main()
{
    int n,a,b,c,d;
    scanf("%d",&n);
    if(n<10)
    printf("%d\n",n);
    if(n>=10&&n<100)
    {
      a=(n%10)*10+n/10;
      printf("%d\n",a);
    }
    if(n>=100&&n<1000)
    {
     b=(n%10)*100+(n/10)%10*10+n/100;
     printf("%d\n",b);
    }
    if(n>=1000&&n<10000)
    {
     c=(n%10)*1000+(n/10)%10*100+(n/100)%10*10+n/1000;
     printf("%d\n",c);
    }
    if(n>=10000&&n<100000)
    {
    d=(n%10)*10000+(n/10)%10*1000+(n/100)%10*100+(n/1000)%10*10+n/10000;
    printf("%d\n",d);
    }
    return 0;
}
int main(){
	int n,a,b,c,d,e;
	scanf("%d",&n);
	if(n<10){
		printf("%d",n);
	}
	else if(n>=10&&n<100){
		a=n/10;
		b=n%10;
		printf("%d%d",b,a);
	}
	else if(n>=100&&n<1000){
		a=n/100;
		b=(n-100*a)/10;
		c=n%10;
		printf("%d%d%d",c,b,a);
	}
	else if(n>=1000&&n<10000){
		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{
		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%10;
		printf("%d%d%d%d%d",e,d,c,b,a);
	}
	return 0;
}
int main()
{
	short length,i,j=1;
	char number[6];
		while(j<=4)
		{
			scanf("%s",number);
			length=strlen(number);
			for(i=length-1;i!=-1;i--)
			{
				printf("%c",number[i]);
			}
			putchar('\n');
			j++;
		}
	return(0);
}
void main()
{
	char a[7],b[7];
	int j,i,n=0;
	scanf("%s",a);
	for(i=0;i<7;i++)
	{
		if(a[i]=='\0')break;
		else n++;
	}
for(i=n-1;i>=0;i--)
	{
		printf("%c",a[i]);
	}
}
int main()
{

char a, b, c, d, e;
a=getchar();
b=getchar();
c=getchar();
d=getchar();
e=getchar();
if( e >= '0' && e <= '9') putchar(e);
if( d >= '0' && d <= '9') putchar(d);
if( c >= '0' && c <= '9') putchar(c);
if( b >= '0' && b <= '9') putchar(b);
if( a >= '0' && a <= '9') putchar(a);
}
int main()
{
	long a,b,c,i,j;
	scanf("%ld",&a);
	c=log(a)/log(10)+1;
	i=pow(10,c);
	j=1;
	b=0;
	while(i>1)
	{
		b=b+(a%i)/(i/10)*j;
		i=i/10;
		j=j*10;
	}
	printf("%ld\n",b);
	return 0;
}
int main()
{
	int num,g,s,b,q,w;                        //????
	cin>>num;                                 //????
	if(num>9999)                              //if?????num?5??????????????
	{
		w=(num/10000)%10;
	    q=(num/1000)%10;
		b=(num/100)%10;
		s=(num/10)%10;
		g=num%10;
		cout<<g<<s<<b<<q<<w<<endl;             //?????
	}
	    else if(num>999)                             //if??
	    {
	               q=(num/1000)%10;
		     b=(num/100)%10;
		     s=(num/10)%10;
		     g=num%10;
		     cout<<g<<s<<b<<q<<endl;            //????
     	}
		     else if(num>99)                    //if??
		     {
		         b=(num/100)%10;
		         s=(num/10)%10;
		         g=num%10;
		         cout<<g<<s<<b<<endl;            //????
		     }
			     else if(num>9)
			{
                                   s=(num/10)%10;
		              g=num%10;
		              cout<<g<<s<<endl;           //????
			      }
	return 0;
}
int main()
{
    int n,a,b,c,d,e;
	scanf("%d",&n);
	a=n/10000;
	b=(n%10000)/1000;
	c=(n%1000)/100;
	d=(n%100)/10;
	e=n%10;
    if (a==0)
	{
	    if(b==0)
		{
			if(c==0)
			{
			    if(d==0)
                    printf("%d",e);
				else
					printf("%d",e*10+d);
			}
			else
				printf("%d",e*100+d*10+c);
		}
		else
			printf("%d",e*1000+d*100+c*10+b);
	}
	else
        printf("%d",e*10000+d*1000+c*100+b*10+a);

	return 0;
}
int main(int argc, char* argv[])
{
	int k=0,i,t;
	char num[6],rum[6];
	scanf("%s",num);
	for (i=0;num[i]!='\0';i++)
	{
      k=k+1;	
	}
    for (i=0;num[i]!='\0';i++)
	{
		t=k-i-1;
		rum[t]=num[i];
	}
	rum[k]='\0';

	
	
		printf("%s\n",rum);

	return 0;
}
main()
{
  int a[99],b[99],c[99],d[99],e[99],x[99],i;
 for(i=1;i<=4;i++)
  	scanf("%d",&x[i]);
 for(i=1;i<=4;i++)
 {  
    if(x[i]>9999)
    {
      a[i]=x[i]/10000;b[i]=(x[i]-a[i]*10000)/1000;c[i]=(x[i]-a[i]*10000-b[i]*1000)/100;d[i]=(x[i]-a[i]*10000-b[i]*1000-c[i]*100)/10;e[i]=(x[i]-a[i]*10000-b[i]*1000-c[i]*100-d[i]*10);
      printf("%d%d%d%d%d\n",e[i],d[i],c[i],b[i],a[i]);
    }
    if(x[i]>999&&x[i]<=9999)
    {
      b[i]=(x[i])/1000;c[i]=(x[i]-b[i]*1000)/100;d[i]=(x[i]-b[i]*1000-c[i]*100)/10;e[i]=(x[i]-b[i]*1000-c[i]*100-d[i]*10);
      printf("%d%d%d%d\n",e[i],d[i],c[i],b[i]);
    }
    if(x[i]>99&&x[i]<=999)
    {
      c[i]=(x[i])/100;d[i]=(x[i]-c[i]*100)/10;e[i]=(x[i]-c[i]*100-d[i]*10);
      printf("%d%d%d\n",e[i],d[i],c[i]);
    }
    if(x[i]>9&&x[i]<=99)
    {
      d[i]=(x[i])/10;e[i]=(x[i]-d[i]*10);
      printf("%d%d\n",e[i],d[i]);
    }
    if(x[i]<=9)
    {
      e[i]=x[i];
      printf("%d\n",e[i]);
    }
 } return 0;
}
int main(){
	int n,a,b,c,d,e;
	scanf("%d",&n);
	if(n<10)
		printf("%d",n);
	else if(n<100){
		a=n/10;
		b=n%10;
		printf("%d",b*10+a);
	}
	else if(n<1000){
		a=n/100;
		b=n/10%10;
		c=n%10;
		printf("%d",c*100+b*10+a);
	}
	else if(n<10000){
		a=n/1000;
		b=n/100%10;
		c=n/10%10;
		d=n%10;
		printf("%d",d*1000+c*100+b*10+a);
	}
	else if(n<100000){
		a=n/10000;
		b=n/1000%10;
		c=n/100%10;
		d=n/10%10;
		e=n%10;
		printf("%d",e*10000+d*1000+c*100+b*10+a);
	}
}
int main()
{
	long s,n;
	int a[5];
	scanf("%ld",&n);
	s=n;
	a[0]=s%10;
	s=s-a[0];
	a[1]=(s%100)/10;
	s=s-10*a[1];
	a[2]=(s%1000)/100;
	s=s-100*a[2];
	a[3]=(s%10000)/1000;
	s=s-1000*a[3];
	a[4]=s/10000;

	if (n<10)
	
		printf("%d",a[0]);
	
	else if (n<100)
	
		printf("%1d%1d",a[0],a[1]);
	
	else if (n<1000)
		printf("%1d%1d%1d",a[0],a[1],a[2]);

	else if (n<10000)
		printf("%1d%1d%1d%1d",a[0],a[1],a[2],a[3]);

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



int main ()
{
	int number, digit[6], nDigit, revNumber;					//?????number?????digit[]????????nDigit?number?????revNumber????
	
	cin>>number;												//????

	digit[1]= number/10000;										//??????????????10000??????????
	digit[2]=(number%10000)/1000;								//?????????????mod10000???????1000???????
	digit[3]=((number%10000)%1000)/100;							//?????????????mod10000???????mod1000???????100???????
	digit[4]=(((number%10000)%1000)%100)/10;					//??????????
	digit[5]=(((number%10000)%1000)%100)%10;					//??????????


	if(number>9999) nDigit=5;									//?????10000????????5???????5??			
	if(number>999&& number <=9999) nDigit=4;					//?????1000-9999????????4?
	if(number>99 && number <=999) nDigit=3;						//?????100-999????????3?
	if(number>9 && number <=99) nDigit=2;						//?????10-99????????2?
	if(number>0 && number <=9) nDigit=1;						//?????1-9????????1?


	revNumber = digit[5]*pow(10.0,nDigit-1) + digit[4]*pow(10.0,nDigit-2) + digit[3]*pow(10.0,nDigit-3) +digit[2]*pow(10.0,nDigit-4) + digit[1]*pow(10.0,nDigit-5);
	//?????? *10^????-1?+??????*10^(???-2?+...+????*10^(0);
	//??????86031?1*10^4 + 3*10^3 + 0*10^2+ 6*10^1 + 8*10^0 = 13068?

		cout<<revNumber;										//?????
	

return 0;														//?0??main?
}
int main()
{
	long n;
	int a,b,c,d,e;
	scanf("%d",&n);	
		if (n<10)
		printf("%d",n);
	 
		else if (n<100)
		{
			a=n%10;
			n=n-a;
			b=n/10;
			printf("%d%d",a,b);
		}
		else if (n<1000)
		{
			a=n%10;
			n=n-a;
			b=(n%100)/10;
			n=n-10*b;
			c=n/100;
			printf("%d%d%d",a,b,c);
		}
		 
		else if (n<10000)
		{
			a=n%10;
			n=n-a;
			b=(n%100)/10;
			n=n-10*b;
			c=(n%1000)/100;
			n=n-100*c;
			d=n/1000;
			printf("%d%d%d%d",a,b,c,d);
		}
		
		else
		{
			a=n%10;
			n=n-a;
			b=(n%100)/10;
			n=n-10*b;
			c=(n%1000)/100;
			n=n-100*c;
			d=(n%10000)/1000;
			n=n-1000*d;
			e=n/10000;
			printf("%d%d%d%d%d",a,b,c,d,e);
		}
	
}
int main()
{
	int a,b,c,d,e,x,i;
	int l[4],g[4];
	for(i=0;i<4;i++)
	{scanf("%d\n",&x);
	l[i]=x;}
	for(i=0;i<4;i++)
	{x=l[i];
	if(x>=10&&x<100) e=x%10,d=x/10,x=10*e+d;
	if(x>=100&&x<1000) e=x%10,d=((x%100)-e)/10,c=x/100,x=100*e+10*d+c;
	if(x>=1000&&x<10000) e=x%10,d=((x%100)-e)/10,c=((x%1000)-(x%100))/100,b=x/1000,x=1000*e+100*d+10*c+b;
	if(x>=10000) e=x%10,d=((x%100)-e)/10,c=((x%1000)-(x%100))/100,b=((x%10000)-(x%1000))/1000,a=x/10000,x=10000*e+1000*d+100*c+10*b+a;
	g[i]=x;}
	printf("%d\n%d\n%d\n%d\n",g[0],g[1],g[2],g[3]);                                     
}
int main()
{
	char num[10];
	int n;
	while(cin>>n){
		int i = 0;
		while(n!=0){
			num[i++]= n%10+'0';
			n /= 10;
		}
		num[i]= '\0';
		cout<<num<<endl;
	}
	return 0;
}
main()
{
	int n,a,b,c,d,l,k;
	scanf("%d",&n);
	if (n<1000000)
	{
	l=n%10;
    d=(n%100-n%10)/10;
	c=(n%1000-n%100)/100;
    b=(n%10000-n%1000)/1000;
	a=(n%100000-n%10000)/10000;
	if (a!=0)
		k=l*1e4+d*1e3+c*1e2+b*1e1+a;
	else if (a==0&&b!=0)
		k=l*1e3+d*1e2+c*1e1+b;
	else if (a==0&&b==0&&c!=0)

		k=l*1e2+d*1e1+c;
	else if (a==0&&b==0&&c==0&&d!=0)
		k=l*1e1+d;
	else if (a==0&&b==0&&c==0&&d==0&&l!=0)
		k=l;
	}
	printf("%d",k);
	return 0;
	
}
void main()
{
	int a[5],b,k=0,i;
    scanf("%d",&b);
	for(i=0;;i++)
	{
		a[i]=b%10;
		b=b/10;
		k=k+1;
		if(b<1)
			break;
	}
	for(i=0;i<k;i++)
		printf("%d",a[i]);
}
int main()
{
int n,i,a[5],j;
cin>>n;
for(i=0;i<=4;i++)
{
if(n==0)
break;
a[i]=n%10;
n=(n-a[i])/10;
}
for(j=0;j<=i-1;j++)
{
n=10*n+a[j];
}
cout<<n<<endl;
return 0;
}
int main()
{
	int a,b,c,d,e,f,g;
	scanf("%d",&a);
	if(a<100)
	{
		b=a%10;
		c=(int)(a/10);
		d=10*b+c;
		printf("%d\n",d);
	}
	else if(a>100&&a<1000)
	{
		b=(int)(a/100);
		c=(int)(a/10)-10*b;
		d=a-100*b-10*c;
		e=100*d+10*c+b;
		printf("%d",e);
	}
	else if(a>1000&&a<10000)
	{
		b=(int)(a/1000);
		c=((a%100)-(a%10))/10;
		d=((a%1000)-(a%100))/100;
		e=a%10;
        f=1000*e+100*c+10*d+b;
		printf("%d",f);
	}
	else
	{
		b=(int)(a/10000);
		c=((a%100)-(a%10))/10;
		d=((a%1000)-(a%100))/100;
        g=((a%10000)-(a%1000))/1000;
		e=a%10;
        f=10000*e+1000*c+100*d+10*g+b;
		printf("%d",f);
	}
	return 0;
}
void main()
{
	int a[9],n,k,i;
	scanf("%d",&n);k=n;
	for(i=0;i<9;i++)
	{
		a[i]=k%10;k=k/10;
	}
	  for(i=1;i<9;i++)
	  {
		a[i]=a[i-1]*10+a[i];
	  }
	k=a[8];
	    while(k%10==0)
		{
		  k=k/10;
		}
		printf("%d",k);
}