semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int sushu(int);
int main()
{
    int m;
    cin>>m;
    for(int i=2;i<=m/2;i++)
    {
        if(sushu(i)&&sushu(m-i))
        cout<<i<<" "<<m-i<<endl;
    }
    
    return 0;
}
int sushu(int n)
{
    int j;
    for( j=2;j<=sqrt(n);j++)
    {
        if(n%j==0)
        {
        return 0;
        break;
        }
    }
    if(j==(int)sqrt(n)+1)
    return 1;
}
int main()
  {
   int m,i=3,n=2,j;
   cin>>m;
   while(i<=m/2){
	     while(n<i){
	      if (i%n!=0)  {
                 if (n>=i-1){
			            j=m-i;
						n=2;
			         while(n<j){
	                               if (j%n!=0){
						                                if(n>=j-1){
											cout<<i<<" "<<j<<"\n";}
									       n++;}
				                      else n=j;
					           }
				      n=i-1; }
				   n++;}
		    else n=i;}
		 i++;
		 n=2;}

	return 0;
}
int main()
{
	int m;
	int i,j,t,k,r;
	int n;
	int flag=1;
	int a[10000];
	scanf("%d",&m);
	t=1;
	for (i=3;i<=m;i=i+2)
	{
		flag=1;
		for (j=3;j<=(int)floor(sqrt((double)i));j++)
		{
			if (i%j==0)
			{
				flag=0;
				break;
			}
		}
		if (flag==1)
		{
			a[t]=i;
			t++;
		}
	}
	n=t-1;
	for (k=1;k<=n;k++)
	{
		for(r=k;r<=n;r++)
		{
			if (a[k]+a[r]==m)
			{
				printf("%d %d\n",a[k],a[r]);
			}
		}
	}

	return 0;
}
int main()
{
	int A[10000],B[10000],m,a=2,b=2,k=1,j=1,i=2,s=1,t=1;
	scanf("%d",&m);
	while(a<m)
	{
		for(i=2;i<a;i++)
		{
			if(a%i==0)
			{
			    break;
			}	
		}
		if(i==a)	
		{
			A[k]=a;
			k++;
		}
				a++;
	}
    while(b<m)
	{
		for(i=2;i<b;i++)
		{
			if(b%i==0)
			{
				break;
			}	
		}
		if(i==b)	
		{
			B[j]=b;
			j++;
		}			
		b++;
	
	}
	while(s<=k)
	{
		t=0;
		while(t<=j)
		{
			if(A[s]+B[t]==m)
			{
				if(s<=t) printf("%d %d\n",A[s],B[t]);
			}
			t++;
		}
		s++;
	}
	return 0;
}
int main()
{
    int m,i,j,n;
    scanf("%d",&m);
    int a[10001];
    n=m/2;
    for (i=2;i<=m;i++)
    	   a[i]=0;
    for(i=2;i<=n;i++)
    {
     if (a[i]==0)
        for(j=i+i;j<=m;j=j+i)
        	a[j]=1;
    }
    for (i=2;i<=n;i++)
    {
    	if ((a[i]==0)&&(a[m-i]==0))
    		printf("%d %d\n",i,m-i);
    }
	return 0;
}
//***************************
//???????????? ?cpp4?
//??????
//???1300012712
//???2013?10?23?
//***************************
int main ()
{
	int m, x, i, j;           // m???????? x?????? i j??????
	cin >> m;
	for (x = 3; x <= m/2; x = x + 2)    // ?????? ???????????m/??
	{
		for (i = 2; i <= sqrt(x); i++)   // ?2?x??????x?????
		{
			if (x % i == 0)
				break;    // ??x?????i?? ????
		}
		if (i > sqrt(x))   // ????????? ?x???
		{
			for (j = 2; j <= sqrt(m-x); j++)  // ??m-x?????
			{
				if (((m - x) % j) == 0) 
					break;  // ??m-x?????j?? ????
			}
			if (j > sqrt(m - x))  // ?????????? m-x????
				cout << x << " " << m - x << endl;  // m?m-x??????????
		}
	}
	return 0;
}
int sushu(int w)
{
	int c,d;
	d=1;
	c=2;
	while(c<=w-1)
	{
		if(w%c==0)
		{
			d=0;
		break;
		}
		c++;
	}
	return d;
}

	int main()
{
	int m,p;
	scanf("%d",&m);
	p=3;
	while(p<=m/2)
	{
		if (sushu(p)&&sushu(m-p))
			printf("%d %d\n",p,m-p);
		p++;
	}
	return 0;
}
int f(int x)
{
    int i,t;
    double k;
    k=sqrt(x);
    if(x%2==0);
    t=0;
    if(x%2==1)
    {for(i=2;i<=k;i++)
     {
       if(x%i==0)
       break;
       }
       if(i>k)
       t=1;
       else
       t=0;
     }
       return t;
}
main()
{
   int m,j;
   scanf("%d",&m);
   for(j=3;j<=(m/2);j++)
   {
     if((f(j)==1)&&(f(m-j)==1))
     printf("%d %d\n",j,m-j);
     }
     getchar();
     getchar();
     getchar();
}
main()
{
      int m,n,i,j,k;
      scanf("%d",&m);
      for(i=3;i<m/2+1;i++)
      {
                        for(j=2;j<i;j++)
                        {
                                        if(i%j==0)
                                        break;
                        }
                        if(j==i)
                        {
                                n=m-i;
                                for(k=2;k<n;k++)
                                {
                                                if(n%k==0)
                                                break;
                                }
                                if(k==n)
                                printf("%d %d\n",i,n);
                                
                        }
      }
      getchar();
      getchar();
}
int main()
{
int m,i;
scanf("%d",&m);
for(i=3;i<=(m/2);i=i+2)
{
     int a,b,p=0,q=0;
	 for(a=2;a<=(i-1);a++)
	 {
	 if(i%a==0) p=p+1;  
	 }
	 if(p==0)
	 {
	 for(b=2;b<=(m-i-1);b++)
	 {
	 if((m-i)%b==0) q=q+1;
	 }
	 if(q==0) printf("%d %d\n",i,m-i);
	 }
}


return 0;
}
/*
 * 1.cpp
 *
 *  Created on: 2012-10-8
 *      Author: Lixurong
 */


int runnian( int a );

int main()
{
	int m;
	cin >> m;
	int a[5000]={0};
	a[1]=2;
	int s=2;
	for( int i=3; i<10000; i++ )
	{
        int k=1;
		for( int j=1; a[j]*a[j]<=i; j++ )
         {
        	 if( i%a[j]==0 )
        	 {
        		 k = 0;
        		 break;
        	 }
         }
		if( k==1 )
		{
			a[s]=i;
			s++;
		}
	}
	for( int i=1; a[i]<m; i++ )
	{
		for( int j=i; a[j]<m; j++ )
		{
			if( a[i]+a[j]==m )
			{
				cout << a[i] << " " << a[j] << endl;
			}
		}
	}
	return 0;
}
int main()
{
int m;
int i,j,k;
scanf("%d",&m);
int s[2000];
s[0]=2;s[1]=3;
k=1;
for(j=3;j<10000;j++)
{
for(i=0;s[i]*s[i]<j;i++)
{
if(j%s[i]==0)
break;
}
if(s[i]*s[i]>j)
{
s[k]=j;
k++;
}
}
for(j=0;s[j]<=m/2;j++)
{
for(i=0;s[i]<=m;i++)
if(m==s[i]+s[j])
{
printf("%d %d\n",s[j],s[i]);
}
}

return 0;
}
int main()
{
	int m,i,j,k,flag;
	scanf("%d",&m);
	for(i=3;i<=m/2;i+=2)
	{
		flag=0;
		for(k=3;k<=sqrt(i);k+=2)
		{
			if(i%k==0)
			{
				flag=1;
			}
		}
		if(flag==0)
		{
			for(j=3;j<=sqrt(m-i);j+=2)
			{
				if((m-i)%j==0)
				{
					flag=1;
				}
			}
			if(flag==0)
			{
				printf("%d %d\n",i,m-i);
			}
		}
	}
	return 0;
}
int main()
{
    int n, m, i, j;
    double k;
    
    cin >> n;
    
    for(i = 3; i <= n / 2; i = i + 2)
    {
        int r = 0;
        
        k = sqrt(i);
        
        for(j = 2; j <= k; j++)
           if(i % j == 0)
	  {
		r++; break;
	   }
                
        if(r) 
           continue;
        r = 0;
        k = sqrt(n - i);
            
        for(j = 2; j <= k; j++)
            if((n - i) % j == 0)
	   {
		r++;  break;
             }
                    
        if(r) 
            continue;
        
        cout << i << " " << (n- i) << endl;
    }
    return 0;
}
// * * * * * * * * * * * * * * *
// *?????????         *
// *??????  1300013011   *
// *???2013.10.25           *
// * * * * * * * * * * * * * * *
int main()
{
	int m, a, b, i, k;           // a,b????,i,k????
	cin >> m;

	for(a = 3; a <= m / 2; a = a + 2)  // ???m/2???
	{
		for(i = 3; i < a; i = i + 2)
		{
			if (a % i == 0)
				break;
		}
		if (i == a)
		{
			b = m - a;        // ?b??m-a

			for(k = 3; k < b; k = k + 2)  // ??b?????
			{
				if(b % k == 0)
					break;
			}
			if (k == b)
				cout << a << " " << b << endl;
		}
	}
	return 0;
}
int main()
{
  int n,i,j,a,b,c,d,e;
  scanf("%d",&n);
  for(i=3;i<=(n/2);i=i+2)
  {
    a=sqrt(i);b=1;
    for(j=2;j<=a;j++)
    {if(i%j==0) b=j;}
    if(b==1)
   {
     c=n-i;d=sqrt(c);e=1;
     for(j=2;j<=d;j++)
     {if(c%j==0) e=j;}
     if(e==1) printf("%d %d\n",i,c);
    }
  }
}
void main()
{
	int m,n;
	int i,j,flag1,flag2;
	scanf("%d",&m);
	for(n=2;n<=m/2;n++){
		flag1=0;
		flag2=0;
		for(i=2;i<n;i++){
			if(n%i==0){
				flag1=1;
				break;
			}
		}

		for(j=2;j<m-n;j++){
			if((m-n)%j==0){
				flag2=1;
				break;
			}
		}
		if(!flag1&&!flag2)
			printf("%d %d\n",n,m-n);
	}
}
int jss(int x);
int main(){
    int m,i;
    scanf("%d",&m);
    for(i=m-2;i>=m/2;i--){
                          if(jss(i)&&jss(m-i)){
                                               printf("%d %d\n",(m-i),i);                     
                          }                      
    }
    return 0;    
}
int jss(int x){
    int j;
    int a=0;
    for(j=x-1;j>=3;j--){
                        if(x%j==0){
                                   a=1;
                                   break;           
                        }                    
    }
    if(x%2==1&&a==0&&x!=1){
                     return 1;                 
    }
    else{
         return 0;
    }      
}
int main ()
{
	int a,i,b,j,n=0,m=0;
	scanf("%d",&a);
	for(i=3;i<=a/2;i=i+2)
	{
		for (j=2;j<i;j++)
		{
			if (i%j!=0)
				n=n+1;
		}
		if (n==i-2)
		{
			b=a-i;
			for (j=2;j<b;j++)
			{
				if (b%j!=0)
					m=m+1;
			}
			if (m==b-2)
				printf ("%d %d\n",i,b);
		}
		n=0;
		m=0;
	}
	return 0;
}
int SS(int i);
int main()
{
	int n,i;
	scanf("%d",&n);
	for(i=3;i<=n/2;i++)
	{
		if(SS(i)&&SS(n-i))
			printf("%d %d\n",i,n-i);
	}
}

int SS(int i)
{
	int k;
	for(k=2;k<=i-1;k++)
		if(i%k==0)break;
		if(k<i)return 0;
		else
			return 1;
}
int main()
{
	int n,k,y,h,i,m,x;
	while (cin >> n&&n!=0)
	{
		for (x=3;x<=n/2;x++)
		{
			k=(int)sqrt(x);
			y=n-x;
			for (i=2;i<=k;i++)
				if ((x%i)==0) break;
				if (i==k+1)
				{
					h=(int)sqrt(y);
					for (m=2;m<=h;m++)
						if ((y%m)==0) break;
						if (m==h+1)
							cout << x << " " << y << endl;
				}
		}
	
	}
	return 0;
}
int isprime(int n)
{
	int i;
	for(i=2;i<n;i++)
		if(n%i==0)
			return 0;
		return 1;
}
int main()
{
	int m,i;
	scanf("%d",&m);
	if((m%2==0)&&(m>=6)&&(m<=10000))
	{
		for(i=3;i<=m/2;i=i+2)
		{
			if(isprime(i)&&isprime(m-i))
				printf("%d %d\n",i,m-i);
		}
	}
	return 0;
}
void main()
{
    int reverse(int num);
	int a1,a2,a3,a4,a5,a6;
	scanf("%d%d%d%d%d%d",&a1,&a2,&a3,&a4,&a5,&a6);
	printf("%d\n%d\n%d\n%d\n%d\n%d\n",reverse(a1),reverse(a2),reverse(a3),reverse(a4),reverse(a5),reverse(a6));
}
int reverse(int num)
{
	int mun,p1,p2,p3,p4,p5;
	if(fabs(num)<10) mun=num;
	else if(fabs(num)>=10&&fabs(num)<100)  p1=num/10,p2=num-p1*10,mun=p2*10+p1;
    else if(fabs(num)>=100&&fabs(num)<1000)  p1=num/100,p2=(num-p1*100)/10,p3=num-p1*100-p2*10,mun=p3*100+p2*10+p1;
    else if(fabs(num)>=1000&&fabs(num)<10000)  p1=num/1000,p2=(num-p1*1000)/100,p3=(num-p1*1000-p2*100)/10,p4=num-p1*1000-p2*100-p3*10,mun=p4*1000+p3*100+p2*10+p1;
    else if(fabs(num)>=10000) p1=num/10000,p2=(num-p1*10000)/1000,p3=(num-p1*10000-p2*1000)/100,p4=(num-p1*10000-p2*1000-p3*100)/10,p5=num-p1*10000-p2*1000-p3*100-p4*10,mun=p5*10000+p4*1000+p3*100+p2*10+p1;
    return(mun);
}
int inverse(int a)
{int i=0,b=0,c=0;
	do
	{
		if(a<0){c=1;a=fabs(a);}
		b=b*10+a%10;
		a/=10;
		i++;
	}
	while(a>0);
	if(c==1)b=-b;
	return b;
}
void main()
{
	int i,num;
    for(i=0;i<6;i++)
	{
		scanf("%d",&num);
		printf("%d\n",inverse(num));
	}
}
int fxs(int x)
{ 
  int i;
  int y=0;  
  for(i=10;x!=0;)
  {
    y=y*10+x%i;
    x=x/i;
  }
  return y;
}
main()
{ 
 for(int i=1;i<=6;i++)
 {
   int a,b;
   scanf("%d",&a);
   b=fxs(a);
   printf("%d\n",b);
 }
}
int main()
{
	int reverse(int num);
	int i,a[6],b[6];
	for(i=0;i<6;i++)
	{
		scanf("%d",&a[i]);
		b[i]=reverse(a[i]);
	}
	for(i=0;i<6;i++)
	{
		printf("%d\n",b[i]);
	}
	return 0;
}
int reverse(int num)
{
	int s=0,k;
	do
	{
		k=num%10;
		num=num/10;
                   s=(s+k)*10;
	}
           while(num!=0);
s=s/10;
return(s);
}
int main()
{
	int a[6];
	int i;
	for(i=0;i<6;i++)
	{
	scanf("%d",&a[i]);
	}
	for(i=0;i<6;i++)
		fxs(a[i]);
	return 0;

}
	
void fxs(int a)
{
	int i,b=0;
	int c[15]={0};
	if(a<0)printf("-");
	
	a=abs(a);
	for(i=0;a>0;a=a/10,i++)
	{
		c[i]=a%10;
		b++;
	}
	for(i=0;i<b;i++)
		a=c[i]*pow(10,b-i-1)+a;
	printf("%d\n",a);
}
int reverse(int num)
{int x=0,y=1,i=0,j=0;int fuhao=1;int a[12];
//cin>>num;
if(num<0)fuhao=-1;
num=abs(num);
while(i<12){
	if(num<pow(10,(double)i))break;
	y=10*y;
	i++;}
//cout<<i;

for(j=1;j<=i;j++){a[j]=num/(int)pow(10,(double)(i-j));num=num-a[j]*(int)pow(10,(double)(i-j));}
for(j=0;j<i;j++)//cout<<a[j]<<endl;
	x=x+a[i-j]*pow(10,(double)(i-j-1));
//cout<<x<<endl;

x=fuhao*x;

return (x);

}
int main()
{int i=0;int num;
	for(i=1;i<=6;i++)
	{cin>>num;cout<<reverse(num)<<endl;}
	return 0;
}
int main()
{
	int x,a,b,c,d,e,i;
	for(i=1;i<7;i++)
	{
		scanf("%d",&x);
		if(x==0||x==-0)
		{
			c=0;
			printf("%d\n",c);
		}
		else if(x>0)
		{
			if(x/10000>0)
			{
				a=x/10000;
				b=(x%10000)/1000;
				c=(x%1000)/100;
				d=(x%100)/10;
				e=x%10;
				printf("%d\n",e*10000+d*1000+c*100+b*10+a);

			}

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

		else if(x<0)
		{
			x=-x;
			if(x/10000>0)
			{
				a=x/10000;
				b=(x%10000)/1000;
				c=(x%1000)/100;
				d=(x%100)/10;
				e=x%10;
				printf("%d\n",-(e*10000+d*1000+c*100+b*10+a));

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

			
	
		}
	}
		
		return 0;

}
main()
{   int s,n,c,i;
    for(i=1;i<=6;i++)
  {  scanf("%d",&n);
    if(n==0)
    printf("0\n");
     
   if(n>0)
    {for(s=0;n!=0;)  
    { c=n%10;
    s=c*10+s*10;           
    n=n/10;           
                      }     
    printf("%d\n",s/10); 
                              }
    if(n<0)
    {
    for(s=0,n=-n;n!=0;)
    {c=n%10;
     s=c*10+s*10;             
     n=n/10;      
                         }                     
    printf("-%d\n",s/10);                      
                            }                    
   }         
                  
}
int reverse(int a)
{
	int n,b[10],c[10],i,ra,sum=0;
	if(a>0)
	{
		n=log10(a)+1;
	for(i=0;i<n;i++)
	{
		b[i]=a/(int)pow(10,n-i-1);
		c[i]=a%(int)pow(10,n-i-1);
		a=c[i];
	}
	for(i=0;i<n;i++)
	{
		ra=b[i]*pow(10,i);
		sum=sum+ra;
	}
	return(sum);
	}
	
	if(a<0)
	{
		a=-a;
			n=log10(a)+1;
	for(i=0;i<n;i++)
	{
		b[i]=a/(int)pow(10,n-i-1);
		c[i]=a%(int)pow(10,n-i-1);
		a=c[i];
	}
	for(i=0;i<n;i++)
	{
		ra=b[i]*pow(10,i);
		sum=sum+ra;
	}
	return(-sum);
	}

	if(a==0)
	{
		return(0);
	}
}

void main()
{
	int i,a[6];
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
	for(i=0;i<6;i++)
		printf("%d\n",reverse(a[i]));
}
void fanxu(char *p,int n);
void fanxu(char *p,int n)
{
	int i,j;
	char temp;
	if((*p=='-'&&*(p+1)=='0')||*p=='0') {*p='0';*(p+1)='\0';return;}
else if(*p=='-'&&*(p+1)!='0')
      {  for(i=n-1;i>=0;i--)
             if(*(p+i)!='0') {*(p+i+1)='\0';break;}
        j=i;
        for(i=1;i<=j/2;i++)
	       {temp=*(p+i); *(p+i)=*(p+j+1-i);*(p+j+1-i)=temp;}
	  
	  }  
else  {  for(i=n-1;i>=0;i--)
             if(*(p+i)!='0') {*(p+i+1)='\0';break;}
        j=i;
        for(i=0;i<=j/2;i++)
	       {temp=*(p+i); *(p+i)=*(p+j-i);*(p+j-i)=temp;}
	  
	  }  	  
}


int main()
{
	int i,len;
	char str[300];
	for(i=0;i<6;i++)
	{gets(str);len=strlen(str);
	fanxu(str,len);
	printf("%s\n",str);
	}
	return 0;
}
//?????
//??????
//?????
int QuLing(int num)
{
	while(num%10==0)
		num/=10;
	return num;
}
void reverse(int num)
{
	cout<<num%10;
	if(num/10!=0) reverse(num/10);
	else cout<<endl;
}

int main()
{
	int a[6];
	for(int i=0;i<6;i++)
		cin>>a[i];
	for(int i=0;i<6;i++)
		if(a[i]>=0)	reverse(QuLing(a[i]));
		else
		{
			cout<<"-";
			reverse(QuLing(-a[i]));
		}
	return 0;
}
//#include<stdafx.h>

int reverse(int num)
{
	int y,z=0;

	if(num>0)
	{
		while(num>=1)
		{
                           y=num%10;
			z=10*z+y;
			num=num/10;
		}
	}
         else if(num==0) z=0;
	else
	{
		num=-num;
		while(num>=1)
		{
                            y=num%10;
			z=10*z+y;
			num=num/10;
		}
		z=-z;
	}
	return z;
}

void main()
{
	int a[6],i;

	for(i=0;i<6;i++)
	{
		scanf("%d",&a[i]);
		printf("%d\n",reverse(a[i]));
	}
}
void main()
{
	int i,A[6];
	int FanXu (int x);
	for (i=0;i<6;i++)
		scanf("%d",&A[i]);
	for (i=0;i<6;i++)
		A[i]=FanXu(A[i]);
	for (i=0;i<6;i++)
		printf("%d\n",A[i]);
}

int FanXu (int x)
{
	int a,b,c,d,e,fanxu;
	if (x>=0)
	{
		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 (a!=0)
			fanxu=e*10000+d*1000+c*100+b*10+a;
		else if (b!=0)
			fanxu=e*1000+d*100+c*10+b;
		else if (c!=0)
			fanxu=e*100+d*10+c;
		else if (d!=0)
			fanxu=e*10+d;
		else if (e!=0)
			fanxu=e;
		else
			fanxu=0;
		return(fanxu);
	}
	else 
	{
		x=-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 (a!=0)
			fanxu=e*10000+d*1000+c*100+b*10+a;
		else if (b!=0)
			fanxu=e*1000+d*100+c*10+b;
		else if (c!=0)
			fanxu=e*100+d*10+c;
		else if (d!=0)
			fanxu=e*10+d;
		else if (e!=0)
			fanxu=e;
		else
			fanxu=0;
		return(-fanxu);
	}
}
int main()
{
    void dx ( char str[]);
    int j;
    char str[100];
    for(j=1;j<=6;j++)
      {
        cin.get(str,100,'\n');
        dx (str);
        getchar();
      }    
    
    
    return 0;
}

   void  dx ( char str[])
   {
     int i=0;
     if(str[0]=='-')
      {
       cout<<str[0];
       for(i=strlen(str)-1;i>=1;i--)
         if(str[i]==48) continue;
         else break;
       for(i;i>=1;i--)
         cout<<str[i];
       cout<<endl;
       } 
      else
        {
          for(i=strlen(str)-1;i>=1;i--)
            if(str[i]==48) continue;
          else break;
          for(i;i>=0;i--)
              cout<<str[i];
          cout<<endl;
        }
     }
void main()
{
	int reverse(int num);
	int a[6],i;
	for(i=0;i<6;i++)
		scanf("%d",&a[i]);
	for(i=0;i<6;i++)
		printf("%d\n",reverse(a[i]));
}

int reverse(int num)
{
	int n;
	if(-10<num&&10>num)
		n=num;
	else if(-100<num&&100>num)
		n=(num-(num/10)*10)*10+num/10;
	else if(-1000<num&&1000>num)
		n=(num-(num/10)*10)*100+(num/10-(num/100)*10)*10+num/100;
	else if(-10000<num&&10000>num)
		n=(num-(num/10)*10)*1000+(num/10-(num/100)*10)*100+(num/100-(num/1000)*10)*10+num/1000;
	else if(-100000<num&&100000>num)
		n=((long)num-((long)num/10)*10)*10000+(num/10-(num/100)*10)*1000+(num/100-(num/1000)*10)*100+(num/1000-(num/10000)*10)*10+num/10000;
	return (n);
}
int f(int k)
{int p=1,y=0,j,i,q;
	if(k<0)
p=-1;
	k=fabs(k);
int a[5];
for(i=4;i>=0;i--)
{a[i]=k/pow(10,i);
k=k-a[i]*pow(10,i);
}

for(i=4;i>=0;i--)
if(a[i]!=0)
break;
for(j=0;j<5;j++)
if(a[j]!=0)
break;
for(q=j;q<=i;q++)
{y=a[q]*pow(10,i-q)+y;
}
y=y*p;
return(y);
}
void main()
{int i;
int a[6];
for(i=0;i<6;i++)
scanf("%d",&a[i]);
	for(i=0;i<6;i++)
		printf("%d\n",f(a[i]));
}
int main()
{
	int reverse(int sum);
	int sum,i;
	for(i=0;i<6;i++)
	{
		scanf("%d",&sum);
		reverse(sum);
	}
	
	
	return 0;
}

int reverse(int sum)
{
	int yushu;
	if(sum<0)
	{
		printf("-");
		sum=-sum;
	}
	if(sum==0) printf("%d",sum);
	yushu=sum%10;
	while((yushu==0)&&(sum!=0))
	{
	    sum=sum/10;
		yushu=sum%10;
	}
    
	while(sum!=0)
	{
		printf("%d",yushu);
		sum=(sum-yushu)/10;
		yushu=sum%10;
	}
	printf("\n");
	return 0;
}
long long reverse(int n){
int flag=0;
if (n<0)
flag=1,n=-n;
int a=1,t=0,n1=0;
while (10*a<=n)
a*=10,t++;
for (int i=0;i<=t;i++)
n1+=n/a*(int)pow((double)10,i),n%=a,a/=10;
if (flag==1)
n1=-n1;
return n1;
}
 
int main(){
        int n;
for (int i=1;i<=6;i++)
{
cin >> n;
cout << reverse(n) << endl;
}
        return 0;
}
int reverse(int num){
	int k,N[100],i,rev;
	rev=0;
	if(num<10)
		return num;
	if(num>=10){
		k=0;
		while(1){
			if(num>0){
				N[k]=num%10;
				k++;
				num/=10;
			}else
				break;
		}
		for(i=0;i<k;i++)
			rev+=pow(10,i)*N[k-1-i];
		return rev;
	}
}

int main(){
	int i,sz[6],rev[6];
	for(i=0;i<6;i++)
		scanf("%d",&sz[i]);
	for(i=0;i<6;i++){
		if(sz[i]<0){
			sz[i]=-sz[i];
			rev[i]=reverse(sz[i]);
			printf("-%d\n",rev[i]);
		}else{
			rev[i]=reverse(sz[i]);
			printf("%d\n",rev[i]);
		}
	}
	return 0;
}
int reverse(int num);
void main()
{
	int a[6],i,b[6];
	for(i=0;i<6;i++)
	scanf("%d",&a[i]);
	for(i=0;i<6;i++)
	{
		b[i]=reverse(a[i]);
	printf("%d\n",b[i]);
	}
}

int reverse(int num)
{
	int s=0,i,j,k=0,t;
	if(num<0)
	{
		num=0-num;
		k=1;
	}
	for(i=0;;i++)
	{
		t=pow(10,i);
		if((num%t)==num)
			break;
	}
	for(j=0;j<i;j++)
	{
		s+=(num%10)*pow(10,i-j-1);
		num=(num-num%10)/10;
	}
	if(k)
		return -s;
	else
		return s;
}
void main()
{
    int reverse(int num);
    int num,i;
    for(i=0;i<6;i=i+1)
    {
	scanf("%d",&num);
	num=reverse(num);
	printf("%d\n",num);
    }
}

int reverse(int num)
{
    int a[5];
    int n,i,t,sign=1;
    if(num==0)
	return(num);
    else
    {
    if(num<0)
    sign=-1;
    num=num*sign;
    n=log10(num);
    for(i=0;i<=n;i=i+1)
    {
	a[i]=num/pow(10,n-i);
	num=num-a[i]*pow(10,n-i);
    }
    for(i=0;i<n/2+1;i=i+1)
    {
	t=a[i];
	a[i]=a[n-i];
	a[n-i]=t;
    }
    for(i=0;i<=
    n;i=i+1)
    {
	num=num+a[i]*pow(10,n-i);
    }
    num=num*sign;
    return num;
    }
}
int num(int n)
{int c,x,y,i,j,a[100],k,nu;j=0;nu=0;

if(n>0)nu=1;if(n<0){nu=-1;n=n*nu;}
y=log10(n);
for(i=y;i>=0;i--){x=n/(pow(10,i));a[j]=x;j++;n=n-x*pow(10,i);}
k=0;j=0;x=0;
for(i=0;i<=y;i++){k=k+a[i]*pow(10,x);x++;}
return (k*nu);
}







int main()
{int l,m;
 for(l=0;scanf("%d",&m)==1;l++)
	{ 
	 printf("%d\n",num(m));}
return 0;}
main()
{char a[6][99999];
 int i,k,j,m,n,p,q;
 void re(char x[99999]);
 void xl(char x[99999]);
 for(i=0;i<6;i++)
 {scanf("%s",a[i]);re(a[i]);xl(a[i]);}
 for(i=0;i<6;i++)
  printf("%s\n",a[i]);

}
 
 
 void re(char x[99999])
 {int i,t;
  int l=strlen(x); 
  if(strcmp(x,"-0")==0) 
    strcpy(x,"0");
  else 
   { if(x[0]=='-') 
     { for(i=1;i<=(l/2);i++)
       {t=x[i];x[i]=x[l-i];x[l-i]=t;}
     }
     else
     { for(i=0;i<(l/2);i++)
       {t=x[i];x[i]=x[l-i-1];x[l-i-1]=t;}  
     }      
   }
 }
 void xl(char x[99999])
 {int i,p;
  if(strcmp(x,"0")!=0)
     {if(x[0]=='-')
       {for(i=1,p=0;x[i]=='0';i++)
          {p++;}
        for(i=p+1;x[i]!='\0';i++)
         {x[i-p] = x[i];}
        x[strlen(x)-p]='\0';
       }
      else 
       {for(i=0,p=0;x[i]=='0';i++)
         {p++;}
        for(i=p;x[i]!='\0';i++)
         {x[i-p]=x[i];}
        x[strlen(x)-p]='\0'; 
       }
   
     }
 }
void main()
{
    int p=0,s,i;
    long int n,t;
    for(i=0;i<6;i++)
    {
    	scanf("%ld",&n);
    	if(n>0)
    	p=1;
    	else if(n<0)
    	 {p=-1;
    	 n=-n;}
    	 s=0;
    	 t=0;
    	 
    	 
    	 do
    	 {
    	 	s=n%10;
    	 	n=n/10;
    	 	
    	 	t=t*10+s;
    	 	
          }
        while(n!=0);
    if(p>0)
    printf("%ld\n",t);
    else if(p<0)
    printf("-%ld\n",t);
    else 
    printf("0");	
    }
}
void main()
{
	int reverse(int num); 
	
	int num=0;
	scanf("%d",&num);
	printf("%d\n", reverse(num));
	scanf("%d",&num);
	printf("%d\n", reverse(num));
	scanf("%d",&num);
	printf("%d\n", reverse(num));
	scanf("%d",&num);
	printf("%d\n", reverse(num));
	scanf("%d",&num);
	printf("%d\n", reverse(num));
	scanf("%d",&num);
	printf("%d\n", reverse(num));
}

int reverse (int num)
{
	int r=0,flag=0;
	if (num==0) r=0;
	else 
	{
		switch (num/abs(num))
		{
		case -1: num=num*(-1);flag=1;
		case 1: while(num)
				{
					r=r*10+num%10;
					num=num/10;
				}
		}
		if (flag==1) r=r*(-1);
	}

	/*
		?????num???????r=0?flag=0???switch???
			[1](num=0) r=0,break??
			[2](num<0) ?num?-1?flag=1????break????[3]????
			[3](num>0)
			?while???????????num??0?
				r=r*10+num%10;
				num=num/10;
		??switch????flag???0??????r??-1?
	*/
	return(r);
}
int fanxu(int num)
{
    cout<<num%10;
    if(num/10!=0) fanxu(num/10);
}//????????? 
int main()
{
    int shu[6],i;
    for(i=0;i<6;i++) cin>>shu[i];
    for(i=0;i<6;i++)
    {
                    if(shu[i]!=0 && shu[i]%10==0)
                    {
                                    do
                                    {
                                        shu[i]=shu[i]/10;
                                    }while(shu[i]%10==0);
                    }//??10??????????10???? 
                    if(shu[i]>=0)
                    {
                                 fanxu(shu[i]);
                                 cout<<endl;
                    }//???????? 
                    else 
                    {
                         cout<<"-";
                         shu[i]=-shu[i];
                         fanxu(shu[i]);
                         cout<<endl;
                    }//??????? 
    }
cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();
return 0;
}