semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
int main(){
	char input[10000][300];
	char output[10000][300];
	int n;
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",input[i]);
	    int m=strlen(input[i]);
		  for(int j=0;j<m;j++){
			if(input[i][j]=='A')
				output[i][j]='T';
			else if(input[i][j]=='T')
				output[i][j]='A';
			else if(input[i][j]=='C')
				output[i][j]='G';
			else if(input[i][j]=='G')
				output[i][j]='C';
		}
		printf("%s\n",output[i]);
	}
	getchar();
	getchar();
		return 0;
}
struct point{
    char A[256];
	char B[256];
};
int main(){
	int n,i,j;
	scanf("%d",&n);
	struct point chain[n];
	for(i=0;i<n;i++){
		scanf("%s",&(chain[i].A));
	}
	for(i=0;i<n;i++){
		for(j=0;chain[i].A[j];j++){
			if(chain[i].A[j]=='A'){
				chain[i].B[j]='T';
			}
			if(chain[i].A[j]=='T'){
				chain[i].B[j]='A';
			}
			if(chain[i].A[j]=='C'){
				chain[i].B[j]='G';
			}
			if(chain[i].A[j]=='G'){
				chain[i].B[j]='C';
			}
		}chain[i].B[j]='\0';
	}
	for(i=0;i<n;i++){
		printf("%s\n",chain[i].B);
	}
	return 0;
}
int main()
{
	int n,i,j;
	scanf("%d",&n);
	char s[256];
	for(i=0;i<n;i++)
	{
	   scanf("%s",s);

	   for(j=0;j<strlen(s);j++)
	   {
		   if(j<strlen(s)-1)
		   {
		      if(s[j]=='A') printf("T");
		      if(s[j]=='T') printf("A");
		      if(s[j]=='C') printf("G");
		      if(s[j]=='G') printf("C");
		   }
		   else
		   {
			  if(s[j]=='A') printf("T\n");
		      if(s[j]=='T') printf("A\n");
		      if(s[j]=='C') printf("G\n");
		      if(s[j]=='G') printf("C\n");
		   }

	   }

	}
	return 0;
}
int main()
{
	int n,i,a[1000],j;
	char s[1000][256];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",s[i]);
		a[i]=strlen(s[i]);
		for(j=0;j<a[i];j++)
		{
			if(s[i][j]=='A'){
				s[i][j]='T';
			}else{
				if(s[i][j]=='T'){
					s[i][j]='A';
				}else{
					if(s[i][j]=='C'){
						s[i][j]='G';
					}else{
						s[i][j]='C';
					}
				}
			}
		}
	}
	for(i=0;i<n;i++)
	{
		printf("%s\n",s[i]);
	}
	return 0;
}
int main(){
    char DNA[N1][N2];
    int n,i,k;
    scanf("%d",&n);
    for(i=0;i<n;i++){  
       scanf("%s",DNA[i]);
       for(k=0;DNA[i][k]!=0;k++)
       {
       if(DNA[i][k]=='A'){
          DNA[i][k]='T';}
          else if(DNA[i][k]=='T')
          {DNA[i][k]='A';}
            else if(DNA[i][k]=='G')
            {DNA[i][k]='C';}
              else
              {DNA[i][k]='G';}
              }
    }
    for(i=0;i<n;i++){
    printf("%s\n",DNA[i]);}
    return 0;
    }
int main(){
int n;
scanf("%d\n",&n);
char a[n][256];
char b[n][256];

int i;
for(i=1;i<=n;i++){
scanf("%s\n",a[i-1]);
int x=1;
int t;
for(t=1;t!=0;x++){
if(a[i-1][x-1]==65){b[i-1][x-1]=84;}
if(a[i-1][x-1]==84){b[i-1][x-1]=65;}
if(a[i-1][x-1]==67){b[i-1][x-1]=71;}
if(a[i-1][x-1]==71){b[i-1][x-1]=67;}
if(a[i-1][x-1]==0){t=0;}
}

}

for(int i=1;i<n;i++){printf("%s\n",b[i-1]);}
printf("%s",b[n-1]);
return 0;
}
int main()
{
  int i,j,n;
  char s[1111],d;
  scanf("%d",&n);
  for(j=0;j<n;j++)
  {
    scanf("%s",s);
    for(i=0;s[i]!='\0';i++)
    {
      if(s[i]=='A')
      {
        d='T';
      }
      if(s[i]=='T')
      {
        d='A';
      }
      if(s[i]=='C')
      {
        d='G';
      }
      if(s[i]=='G')
      {
        d='C';
      }
      s[i]=d;
    }
    printf("%s\n",s);
  }
  return 0;
}
int main()
{
   int n,i,a,j,m;
   scanf("%d",&n);
   char A[260],B[n][260];
   for(i=0;i<n;i++)
   {
       scanf("%s",&A);
       a=strlen(A);
       for(j=0;j<a;j++)
       {
           if(A[j]=='A')
           {
               B[i][j]='T';
           }
            if(A[j]=='T')
           {
               B[i][j]='A';
           }
            if(A[j]=='C')
           {
               B[i][j]='G';
           }
            if(A[j]=='G')
           {
               B[i][j]='C';
           }
       }
       B[i][j]='\0';

   }
    for(m=0;m<n-1;m++)
    {
        printf("%s\n",B[m]);
    }
     printf("%s",B[n-1]);

    return 0;

}
int main()
{int n,i,j;
	char jj[1000][300];
		scanf("%d",&n);
for(i=0;i<n;i++)
{
	scanf("%s",jj[i]);
		for(j=0;j<strlen(jj[i]);j++)
		{
			if(jj[i][j]=='A')
			{jj[i][j]='T';
			continue;}
			if(jj[i][j]=='T'){
				jj[i][j]='A';
			continue;}
			if(jj[i][j]=='G'){
				jj[i][j]='C';
			continue;}
			if(jj[i][j]=='C'){
				jj[i][j]='G';
			continue;}
		}
		printf("%s\n",jj[i]);}
		return 0;

return 0;
}
int main(){
	char zfc[9999][256];
	int n;
	int i,j;
	int sz[9999];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",&zfc[i]);
	}
    for(i=0;i<n;i++){
		sz[i]=strlen(zfc[i]);
	}
	for(i=0;i<n;i++){
		for(j=0;j<sz[i];j++){
			if(zfc[i][j]=='A'){
				zfc[i][j]='T';
			}else if(zfc[i][j]=='T'){
				zfc[i][j]='A';
			}else if(zfc[i][j]=='G'){
				zfc[i][j]='C';
			}else if(zfc[i][j]=='C'){
				zfc[i][j]='G';
			}
		}
		zfc[i][sz[i]]='\0';
		printf("%s\n",zfc[i]);

	}

	return 0;
}
int main()
{
	int n, i;
	char s[255];
	scanf("%d", &n);
	for(i=0;i<n;i++)
	{
		scanf("%s", s);
		int len=strlen(s);
		char s1[255]={'\0'};
		for(int j=0;j<len;j++)
		{
			if(s[j]=='A')
			{
				s1[j]='T';
			}
			else if(s[j]=='T')
			{
				s1[j]='A';
			}
			else if(s[j]=='C')
			{
				s1[j]='G';
			}
			else if(s[j]=='G')
			{
				s1[j]='C';
			}
		}
		printf("%s\n", s1);
	}
	return 0;
}
int main(){
    int i,n,t,c;
    char A,T,C,G;
    char jj[500];
    char pd[500];
    scanf("%d\n",&n);
    for(i=0;i<n;i++){
        scanf("%s",&jj);
        t=strlen(jj);
        //printf("%d",t);
        for(c=0;c<t;c++){
            if(jj[c]=='A'){
                pd[c]='T';
            }
            else if(jj[c]=='T'){
                pd[c]='A';
            }
            else if(jj[c]=='C'){
                pd[c]='G';
            }
            else if(jj[c]=='G'){
                pd[c]='C';
            }
        }
        pd[t]='\0';
        printf ("%s\n",pd);
    }
    return 0;
}
int main()
{
	char a[1000][256];
	int n,i,j,b[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",a[i]);
	}
	for(i=0;i<n;i++){
		b[i]=strlen(a[i]);
	}
	for(i=0;i<n;i++){
		for(j=0;j<b[i];j++){
			switch(a[i][j])
			{
			    case 'A':
					a[i][j]='T';
					break;
				case 'G':
					a[i][j]='C';
					break;
				case 'C':
					a[i][j]='G';
					break;
				case 'T':
					a[i][j]='A';
					break;
			}
		}
	}
	for(i=0;i<n;i++){
		printf("%s\n",a[i]);
	}
	return 0;
}
int main()
{
	char zfc[256];
	char zfcsc[256];
	int  n;
	char a='A',t='T',g='G',c='C';
//	char x,y;
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%s",&zfc);
		for(int j=0;j<256;j++){
			if(zfc[j]==a){
				zfcsc[j]=t;
			}
			else if(zfc[j]==t){
				zfcsc[j]=a;
			}
			else if(zfc[j]==g){
				zfcsc[j]=c;
			}
			else if(zfc[j]==c){
				zfcsc[j]=g;
			}
			else  if(zfc[j]=='\0'){
				zfcsc[j]='\0';
			}
		}
		printf("%s\n",zfcsc);
	}
	return 0;
}
char mb[30000][300],fy[30000][300];
int main(){
	
	int i=0,j=0,n;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",mb[i]);
		}
	for(i=0;i<n;i++){
		for(j=0;j<strlen(mb[i]);j++){
			if(mb[i][j]=='A'){
				fy[i][j]='T';
			}else if(mb[i][j]=='T'){
				fy[i][j]='A';
	        }else if(mb[i][j]=='C'){
				fy[i][j]='G';
            }else /*if(mb[i][j]=='G')*/{
				fy[i][j]='C';
			}
		}
	}
	for(i=0;i<n;i++){
		for(j=0;j<strlen(mb[i]);j++){
			printf("%c",fy[i][j]);
		}
		printf("\n");
	}
 return 0;   
}
int main()
{
	int n,i,j;
	char a[1000][255]={0},b[1000][255]={0};
	scanf("%d",&n);
	for(i=0; i<n; i++)
	{
		scanf("%s",a[i]);
		int l=strlen(a[i]);
		for(j=0; j<l; j++)
		{
			if(a[i][j]=='A')
				b[i][j]='T';
			if(a[i][j]=='T')
				b[i][j]='A';
			if(a[i][j]=='C')
				b[i][j]='G';
			if(a[i][j]=='G')
				b[i][j]='C';
		}
		printf("%s\n",b[i]);
	}
	return 0;
}
int main()
{
    int n;
	scanf("%d", &n);
	int i;
	int j;
	int chang[1000]={0};
    char jianji1[1000][285];
	   char jianji2[1000][285]={0};
      for(i=0; i<n; i++)
	{
	   scanf("%s", &jianji1[i]);
	}
    for(i=0; i<n; i++)
	{
	    chang[i]=strlen(jianji1[i]);
		for(j=0; j<chang[i]; j++)
		{
			if(jianji1[i][j]=='A')
		{
		   jianji2[i][j]='T' ;
		}
		 if(jianji1[i][j]=='T')
		{
		   jianji2[i][j]='A';
		}
		  if(jianji1[i][j]=='C')
		{
		   jianji2[i][j]='G';
		}
		   if(jianji1[i][j]=='G')
		{
		   jianji2[i][j]='C';
		}
		}
	}
	for(i=0; i<n; i++)
	{
		for(j=0; j<chang[i]; j++)
		{
			if(j==chang[i]-1)
			{
				printf("%c\n", jianji2[i][j]);
			}
			else
			{
			    printf("%c", jianji2[i][j]);
			}
		}
		
	}
	return 0;
}
int main(){
	int n,i;
	char s[1000][260];
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%s",s[i]);
	}
	for(i=1;i<=n;i++){
		int j=0,p;
		p=strlen(s[i]);
        for(j=0;j<p;j++){
		
			if(s[i][j]=='C'){
			s[i][j]='G';
           continue;
			}
            if(s[i][j]=='G'){
				s[i][j]='C';
			continue;
			}
            if(s[i][j]=='A'){
			s[i][j]='T';
			continue;
			}
            if(s[i][j]=='T')
				s[i][j]='A';
		
		}
	}
	for(i=1;i<=n;i++){
		printf("%s\n",s[i]);
	}
	return 0;
}
int main() {
    int n,i;
    scanf("%d",&n);
    char jjl[n][260],hbl[n][260];
    for(i=0;i<n;i++) {
        scanf("%s",jjl[i]);
    }
    int len,a;
    for(i=0;i<n;i++) {
        len=strlen(jjl[i]);
        for(a=0;a<len;a++) {
            if(jjl[i][a]=='A') {
                hbl[i][a]='T';
            }
            if(jjl[i][a]=='T') {
                hbl[i][a]='A';
            }
            if(jjl[i][a]=='C') {
                hbl[i][a]='G';
            }
            if(jjl[i][a]=='G') {
                hbl[i][a]='C';
            }
        }
        hbl[i][len]='\0';
    }
    for(i=0;i<n-1;i++) {
        printf("%s\n",hbl[i]);
    }
    printf("%s",hbl[i]);
    return 0;
}
int main(){
	int N,i,k;
        char lian[300],fanlian[300]={0};
         scanf("%d",&N);
	for(i=0;i<N;i++){
scanf("%s",lian);
for(k=0;k<strlen(lian);k++){
if(lian[k]=='A'){fanlian[k]='T';}
if(lian[k]=='G'){fanlian[k]='C';}
if(lian[k]=='C'){fanlian[k]='G';}
if(lian[k]=='T'){fanlian[k]='A';}
printf("%c",fanlian[k]);
} 
printf("\n");
}
	return 0;
}
int main(int argc, char *argv[])
{
    int n,i,j,t;
    scanf("%d",&n);
    char a[300];
    for(i=1;i<=n;i++)
    {
                     scanf("%s", a);
                     for(j=0;a[j]!='\0';j++)
                     { 
                                            if(a[j]=='A')
                                            a[j]='T';
                                            else if(a[j]=='T')
                                            a[j]='A';
                                            else if(a[j]=='C')
                                            a[j]='G';
                                            else if(a[j]=='G')
                                            a[j]='C';
                     }
                     printf("%s\n",a);
    }
    
    return EXIT_SUCCESS;
}
void check(int, int flag[]);
int main()
{
	int n, flag[1] = {0};
	cin >> n;
    check(n, flag);
    cout << "End";
	return 0;
}

void check(int n, int flag[])
{
	int a, b;
	if (flag[0] == 1)
        return;
	if (n == 1)
	{
	    flag[0] = 1;
	    return;
		check(n, flag);
	}
	if (n != 1 && n % 2 == 1 && flag[0] == 0)
	{
		a = n;
		n = n * 3 + 1;
		cout << a << "*3+1=" << n << endl;
		check(n, flag);
	}
	if (n != 1 && n % 2 == 0 && flag[0] == 0)
	{
		b = n;
		n = n / 2;
		cout << b << "/2=" << n << endl;
		check(n, flag);
	}
}
void jiaogu(int n);

int main()
{
	int n;
	cin >> n;
	jiaogu(n);
	return 0;
}

void jiaogu(int n)
{
	if (n == 1)
		cout << "End" << endl;
	else
	{
		if (n % 2 == 1)
		{
			cout << n << "*" << 3 << "+" << 1 << "=" << n * 3 + 1 << endl;
			jiaogu(n * 3 + 1);
		}
		else
		{
			cout << n << "/" << 2 << "=" << n / 2 << endl;
			jiaogu(n / 2);
		}
	}
}
int main(int argc, char* argv[])
{
	int n;
	int m;
	scanf("%d",&n);
	for(int i=1;i<100;i++)
		{
			if(n==1)
			{
				printf("End");
				break;
			}
			else
			{
			if(n%2==1)
			{
				m=n*3+1;
				printf("%d*3+1=%d\n",n,m);
				n=m;
				m=0;
			}
			if(n%2==0)
			{
				m=n/2;
				printf("%d/2=%d\n",n,m);
				n=m;
				m=0;
			}
			}
		}
	
    return 0;
}
int main()
{
int n;
cin>>n;
for(;n!=1;)
  {
  if(n%2==1)
    {
    cout<<n<<"*3+1="<<n*3+1<<endl;
    n=n*3+1;   
    }       
  else
    {
    cout<<n<<"/2="<<n/2<<endl;
    n=n/2;        
    } 
  }
cout<<"End";
cin.get();
cin.get();
return 0;
}
main()
{
      int a,b,c;
      scanf("%d\n",&a);
      for(;a>1;)
      {
              if(a%2==0) 
              {
                        a=a/2;
                        b=a*2;
                        printf("%d/2=%d\n",b,a);
              }
              else
              {
                  a=a*3+1;
                  c=(a-1)/3;
                  printf("%d*3+1=%d\n",c,a);
              }
      }
      printf("End");
      getchar();
      getchar();
}
int f(int n);
int main( )
{
	int n,i;
	cin >>n;
	for(i=0;i<100;i++){
		if(n==1){
			cout <<"End" <<endl;
			break;
		}
		else{
			if(n%2==0){
				cout <<n <<"/2=" <<f(n) <<endl;}
			else{
				cout <<n <<"*3+1=" <<f(n) <<endl;}
			n=f(n);
		}
	}
	return 0;
}

int f(int n)
{
	if(n%2==0) return n/2;
	else return n*3+1;
}
int main(){
	int n,i,e,f;
	scanf("%d",&n);
	if(n==1){
		printf("End");
	}else{
		e=n;
		for(i=0;i<10000;i++){
			if(e%2!=0&&e!=1){
				f=e;
				e=e*3+1;
				printf("%d*3+1=%d\n",f,e);
			}else{
				f=e;
				e=e/2;
				printf("%d/2=%d\n",f,e);
			}
			if(e==1){
				printf("End");
				break;
			}
		}
	}
return 0;
}
int main()
{
	int n,i;
	int s;
	scanf("%d",&n);
	s=n;
	if(n==1){
		printf("End");
	}
	else{
		for(s=s;s!=1;i++){
			if(n%2==0){
				s=s/2;
				printf("%d/2=%d\n",n,s);
				n=s;
			}
			else{
				s=s*3+1;
				printf("%d*3+1=%d\n",n,s);
				n=s;
			}
		}
		printf("End");
	}
	return 0;
}
void main()
{
  int n;
  scanf("%d",&n);
  if(n==1) printf("End");
  else {for(;;)
  {if(n%2==0) {n=n/2;printf("%d/2=%d\n",2*n,n);if(n==1) {printf("End\n");break;}}
  else {n=n*3+1;printf("%d*3+1=%d\n",(n-1)/3,n);{if(n==1) {printf("End\n");break;}}
  }}
}
}
int main()
{
    int i,j,m,n,p;
    char str[10001],a,b;
    scanf("%d",&m);
    while(m!=1)
    {
        if (m%2!=0)
        {
            n=m;
            m=n*3+1;
            printf("%d*3+1=%d\n",n,m);
        }
        else
        {
            p=m;
            m=p/2;
            printf("%d/2=%d\n",p,m);
        }
    }
    printf("End");
}
//*****************************************************
//???????
//??:??????????
// ??????
//****************************************************** 
int main()                              //??? 
{                                       //????? 
    int num;                            //??????num 
    cin>>num;                           //?? 
    while(num != 1)                     //while??????1?? 
    {
              if(num % 2 == 0)          //if???????? 
              {
                                        //?? 
                     cout<<num<<"/2="<<num/2<<"\n";
                     num = num / 2;
              }
              else 
              {
                   cout<<num<<"*3+1="<<num * 3 + 1<<"\n";
                   num = num * 3 + 1;
              }
    }
    cout<<"End"<<"\n";
    return 0;
}                                     //?????
int f(int a)
{
	if (a % 2 == 0)
		return a / 2;
	return a * 3 + 1;
}

int main()
{
	int a;
	cin >> a;
	while (a != 1)
	{
		if (a % 2 == 0)
			cout << a << "/2=" << f(a) << endl;
		else
			cout << a << "*3+1=" << f(a) << endl;
		a = f(a);
	}
	if (a == 1)
		cout << "End" << endl;
	return 0;
}
void main()
{
 int n;
 void cal(int n);
 scanf("%d",&n);
 if(n==1) printf("End");
 else {cal(n);printf("End");}
}
void cal(int n)
{
	
	while(n!=1)
	{
		if(n%2==0)
		{
			printf("%d/2=%d\n",n,n/2);
		    n=n/2;
        }
		else
		{
            printf("%d*3+1=%d\n",n,n*3+1);
			n=n*3+1;
		}
	}
}
main()
{
  int n,m,k;
  int i;
  n>0;
  scanf("%d",&n);      
for(;;i++)
{ 
  if(n==1)  printf("End");
  else if(n%2==0)
    {
       m=n/2;
       printf("%d/2=%d\n",n,m); 
       n=m;
       continue;       
    }
  else  
    {
        m=n*3+1;
        printf("%d*3+1=%d\n",n,m);
        n=m;
        continue;       
    }
    break;    
}          
}
void process(int m)
{
	int m_change;
	if (m == 1)
	{
		cout << "End" << endl;
		return;
	}
	else
		if (m % 2 == 1)
		{
			m_change = m * 3 + 1;
			cout << m << "*" << 3 << "+" << 1 << "=" << m_change << endl;
			process(m_change);
		}
		else
		{
			m_change = m / 2;
			cout << m << "/" << 2 << "=" << m_change << endl;
			process(m_change);
		}
}
int main()
{
	int n;
	cin >> n;
	process(n);

	return 0;
}
int main()
{
	int n;
	scanf("%d", &n);
	if(n==1)
		printf("End");
	else
	{do
	{
		if(n%2==0)
		{
			printf("%d/2", n);
			n=n/2;
			printf("=%d\n", n);
		}
		else
		{
			printf("%d*3+1", n);
			n=n*3+1;
			printf("=%d\n", n);
		}
		}while(n!=1);	
		printf("End");}

	return 0;
	}
int main(){
	int n,p;
	scanf("%d",&n);
	if(n!=1){
	 for(;;){
		if(n%2==0){
			p=n/2;
			printf("%d/2=%d\n",n,p);
			n=p;
			if(n==1){
				break;
			}
		}
		else{
			p=n*3+1;
			printf("%d*3+1=%d\n",n,p);
			n=p;
			if(n==1){
				break;
			}
		}
	 }
	}
		printf("End");
		return 0;
	}
void jiaogu(int i)
{
    if(i==1) printf("End");
    else
    {
        if(i%2)
        {
            printf("%d*3+1=%d\n",i,i*3+1);
            jiaogu(i*3+1);
        }
        else
        {
            printf("%d/2=%d\n",i,i/2);
            jiaogu(i/2);
        }
    }
}
main()
{
    int n,temp;
    scanf("%d",&n);
    jiaogu(n);
}
/*
 * jiaogu.cpp
 *
 *  Created on: 2012-11-26
 *      Author: dell
 */
void solve(int n){
	if(n%2==1 && n!=1){
		cout<<n<<"*"<<3<<"+"<<1<<"="<<n*3+1<<endl;
		n=n*3+1;
	}
	if(n%2==0){
		cout<<n<<"/"<<2<<"="<<n/2<<endl;
		n=n/2;
	}
	if(n!=1){
		solve(n);
	}
	if(n==1){cout<<"End";}//????????
}
int main(){
	int n;
	cin>>n;
	solve(n);
	return 0;
}//??n?????????????
main()
{
      int c,i,c1,c2;
      scanf("%d",&c);
      for (i=1;;i++)
      {
          if(c%2==1&&c!=1)
          {
          c1=c*3+1;
          printf("%d*3+1=%d\n",c,c1);
          c=c1;
          }
          if(c%2==0)
          {
          c2=c/2;
          printf("%d/2=%d\n",c,c2);
          c=c2;
          }
          if(c==1)
          break;
      } 
      printf("End\n");    
}
int main(){
	int i,j,n,sz[10000],a,b=0;
    scanf("%d",&a);
	while(a!=1){
		if(a%2==0){
			b=a;
			a=a/2;
			printf("%d/2=%d\n",b,a);
		}else{
			b=a;
			a=a*3+1;
			printf("%d*3+1=%d\n",b,a);
		}
	}
	printf("End\n");
	return 0;
}
main()
{int i;
scanf("%d",&i);
while(i!=1)
{if (i%2)
{printf("%d*3+1=%d\n",i,i*3+1);
i=i*3+1;}

else {printf("%d/2=%d\n",i,i/2);
i=i/2;}
}
printf("End\n");
getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();getchar();
}
int jiaogu(int a)
{
	if(a==1)
	{
		cout<<"End"<<endl;
		return 0;
	}
	if(a%2==1)
	{
		cout<<a<<"*3+1="<<a*3+1<<endl;
		a=3*a+1;
	}
	if(a%2==0)
	{
		cout<<a<<"/2="<<a/2<<endl;
		a=a/2;
	}
	jiaogu(a);
	return 0;
}
int main()
{
	int n;
	cin>>n;
	jiaogu(n);
	return 0;
}
/* ????.cpp
 *  Created on: 2012-11-20
 *      Author: ??
 */
int ans(int n) {
	if (n == 1)
		return 0;
	if (n % 2 == 0) {
		cout << n << "/2=" << n / 2 << endl;
		return ans(n / 2);//??
	} else {
		cout << n << "*3+1=" << n * 3 + 1 << endl;
		return ans(n * 3 + 1);//??
	}
}
int main() {
	int n;
	cin >> n;//??
	ans(n);
	cout << "End";//??
	return 0;
}
//************************************
//????1000012825                 *
//??????                       *
//???12.5                         *
//?????????                 *
//************************************
void f( int );     //????
int main ()
{
	int n;
	cin >> n;
	if ( n == 1 )
		cout << "End" << endl; //????1???????
	else
		f(n);   //????
	return 0;
}
void f( int n)
{
	int p = n;
	if (p == 1)
	{
		cout << "End"  << endl;
		return;
	}
	else if ( p % 2 == 0 )
	{
		cout << p << "/2=" << p / 2 << endl; // ?????2??????
		f( p / 2 );
	}
	else
	{
		cout << p << "*3+1=" << p*3+1 << endl;
		f( 3* p + 1);
		
	}
}
//
//  main.cpp
//  Homework
//
//  Created by ??? on 13-11-20.
//  Copyright (c) 2013? ???. All rights reserved.
//


int jiaogu(int n)
{
    if(n==1)
    {
        cout<<"End"<<endl;
        return 0;
    }
    else
        if(n%2==1)
        {
            cout<<n<<"*3+1=";
            n=n*3+1;
            cout<<n<<endl;
            jiaogu(n);
        }
        else
        {
            cout<<n<<"/2=";
            n/=2;
            cout<<n<<endl;
            jiaogu(n);
        }
    return 0;
}

int main()
{
    int n;
    cin>>n;
    jiaogu(n);
    return 0;
}
int main(){
    int s,t;
    scanf("%d",&s);
    if(s==1){
    printf("End");
    }
    while(s!=1){
     if(s%2!=0){
      t=s;
      s=t*3+1;
      printf("%d*3+1=%d\n",t,s);
     }
     if(s%2==0){
      t=s;
      s=t/2;
      printf("%d/2=%d\n",t,s);
     }
     if(s==1){
     printf("End");
     }
     }
    return 0;
}
int change(int x)                              //????
{
	int y=0;
	if (x%2==0)                                //??????
	{
		y=x/2;
		printf("%d/2=%d",x,y);
		cout <<endl;
	}
	else                                       //??????
	{
		y=3*x+1;
		printf("%d*3+1=%d",x,y);
		cout <<endl;
	}
	return y;
}
int main()                                      
{
	int num=0;
	cin >>num;
	while (num!=1) num=change(num);            //??????
          cout <<"End";
	return 0;
}
int main()
{
	int n,j;//?????n,j????n??
	cin>>n;
	while (n!=1)
	{
		if (n%2==1)
		{
			j=n;
			n=3*n+1;
			cout<<j<<"*3+1="<<n<<endl;
		}
		else if (n%2==0)
		{
			j=n;
			n=n/2;
			cout<<j<<"/2="<<n<<endl;
		}
	}
	cout<<"End"<<endl;
	cin.get();
	return 0;
}
int b;
int jishu(int n);
int oushu(int n)
	{
		int a;
		a=n;
		n=n/2;
        printf("%d/2=%d\n",a,n);
		if(n==1)
			return(0);
		else if(n%2==0)
			return oushu(n);
		else
			return jishu(n);
	}
        int jishu(int n)
		{
		  int b;
		  b=n;
		  n=n*3+1;
          printf("%d*3+1=%d\n",b,n);
		  if(n==1)
          return(0);
		  else if(n%2==0)
			return oushu(n);
		  else
			return jishu(n);
		}

void main()
{
	scanf("%d",&b);
	if(b==1)
	{printf("End");return;}
	else if(b%2==0)
		oushu(b);
	else
		jishu(b);
    printf("End");
}
int main()
{
	int number;//?????
	cin>>number;
	while(number!=1)
	{
		if(number%2!=0)
		{
			cout<<number<<"*3+1=";
			number=number*3+1;
			cout<<number<<endl;
		}
		else
		{
			cout<<number<<"/2=";
			number=number/2;
			cout<<number<<endl;
		}
	}
	cout<<"End";
	return 0;
}
int main()
{
 int n,m;
 scanf("%d",&n);
 while(n!=1)
 {if(n%2==0){m=n;n=m/2;printf("%d/2=%d\n",m,n);continue;}			
 if(n%2!=0&&n!=1){m=n;n=m*3+1;printf("%d*3+1=%d\n",m,n);continue;}				}
 printf("End\n");
return 0;
}
void main()
{
	int a,b;
	scanf("%d",&a);
	for(;a!=1;)
	{
		if(a%2==1)
			printf("%d*3+1=%d\n",a,b=a*3+1);
		else printf("%d/2=%d\n",a,b=a/2);
			a=b;
	}
	printf("End");
}
/*
 * jiaogucaixiang.cpp
 *
 *  Created on: 2011-12-21
 *      Author: 1100012857
 */
int main(void)
{
	int num;
	cin>>num;
	while(true)
	{
		if(num==1)
			break;
		else
		{
			switch(num%2)
			{
			case 0:
			{
				cout<<num<<"/2="<<num/2<<endl;
				num/=2;
				break;
			}
			case 1:
			{
				cout<<num<<"*3+1="<<num*3+1<<endl;
				num=num*3+1;
				break;
			}
			default:;
			}
		}
	}
	cout<<"End"<<endl;
	return 0;
}
int main()
{
    int a;
    scanf("%d\n",&a);
    if(a==1)printf("End\n");
    else
    {
        do
        {
                            x:
               if(a%2==0) printf("%d/2=%d\n",a,a/2),a=a/2;
               else printf("%d*3+1=%d\n",a,a*3+1),a=a*3+1;
               if(a==1)goto y;
               else goto x;
        }
        while(a=1);
    y:
    printf("End\n");
}
return 0;
}
int main(){
	int n;
	scanf("%d",&n);
	while (n>1)
	{
		if (n%2==0)
			{
			printf("%d/2=",n);
			n=n/2;
			printf("%d\n",n);
			}
		if (n==1)
			break;
		if (n%2!=0)
			{
			printf("%d*3+1=",n);
			n=n*3+1;
			printf("%d\n",n);
			}
	}
	printf("End");
	return 0;
}
int main()
{ int n;
  int print(int n);
  scanf("%d\n",&n);
  if (n!=1)  print(n);
  printf("End");
}
int print(int n)
{ int a,b;
  if (n%2==0) {a=(n/2);printf("%d/2=%d\n",n,a);}
     else {a=(n*3+1);printf("%d*3+1=%d\n",n,a);}
  if (a!=1) {b=print(a);}
return(0);
}