int main()
{
	int n;
	cin >> n;

	for (int i = 0; i < n ;i++)
	{
		char c[10000] ={0};
		cin >> c;

		for (int j = 0; c[j] != '\0'; j++)
		{
			switch(c[j])
			{
			case'A' : cout << "T"; break;
			case'T' : cout << "A"; break;
			case'C': cout << "G" ; break;
			case'G': cout << "C"; break;
			}
		}
		cout << endl;
	}

	return 0;
}


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


char fy(char x)
   {
     char z;
     switch(x)
     {
           case'T':z='A';break;
           case'A':z='T';break;
           case'G':z='C';break;
           case'C':z='G';break;
           default:z='\0';
     }
     return z;
   }
int main(int argc, char *argv[])
{
  char c;
  char a[255]={'\0'};
  int i,n,j,k;
  scanf("%d\n",&n);
  for(j=1;j<=n;j++)
  {
  for(i=0;i<255;i++)
  a[i]='\0';
  scanf("%s",a);
  for(i=254;i>=0;i--)
     {
         if(a[i]!='\0')
         {k=i;
          break;}
     }
  for(i=0;i<k;i++)
     {c=fy(a[i]);
      printf("%c",c);
      }
     c=fy(a[k]);
     printf("%c\n",c);
  }
  return 0;
}


void main()
{
	int i,n;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		int len;
		int j;
		char line[256]={'\0'};
		scanf("%s",line);
		len=strlen(line);
		for(j=0;j<len;j++)
			switch(line[j])
		{
			case 'A': line[j]='T';continue;
			case 'T': line[j]='A';continue;
			case 'C': line[j]='G';continue;
			case 'G': line[j]='C';continue;
		}
		printf("%s\n",line);
	}
}


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


  int main(){
	  int n,i,k;
	  char a[256];
	  scanf("%d",&n);
	  for(i=0;i<n;i++){
	   scanf("%s",a);                                                                                for(k=0;a[k]!='\0';k++){
			  if(a[k]=='A')
			  {
				  printf("T");
				  continue;
			  }
             if(a[k]=='G')
			 {
				  printf("C");
				  continue;
			  }
             if(a[k]=='C')
			 {
				  printf("G");
				  continue;
			  }

             if(a[k]=='T')
			 {
				  printf("A");
				  continue;
			  }
		  }
		  printf("\n");
	  }
	  return 0;
  }


int main()
{
	int m,i,j,k=0;
	char q;
	scanf("%d",&m);
	for(i=0;i<m;i++){
		for(j=0;j<200;j++){
				scanf("%c",&q);
		 switch(q)
			{
			case'A':printf("T");
				break;
			case'T':printf("A");
				break;
			case'C':printf("G");
				break;
			case'G':printf("C");
				break;
	 			default :printf("\n");
				}
		}
	}
	return 0;
}


int main()
{
	char a[256];
	int n, j, i;
	cin >> n;
	for(i = 0;i < n;i++)
	{
		cin >> a;
		for(j = 0;j < strlen(a);j++)
			switch(a[j])
		{
			case 'A': cout << 'T';break;
			case 'T': cout << 'A';break;
			case 'G': cout << 'C';break;
			case 'C': cout << 'G';break;
		}
		cout << endl;
	}
	return 0;
}


int main()
{
	int n,i,j,sum=0,len;
	char  a[260];
	scanf("%d",&n);

	  for(j=0;j<n;j++)
	 {
		  len=0;
      scanf("%s",&a);
       len=strlen(a);
	for(i=0;i<len;i++)
	{

		if(i!=len-1)
		{
	  if (a[i]=='A')
	  {
        printf("T");
	  }
	  else if(a[i]=='T')
	  {
        printf("A");
	  }
	  else if(a[i]=='G')
	  {
        printf("C");

	  }
      else if(a[i]=='C')
	  {
        printf("G");
	  }
		}
		else
			{
	  if (a[i]=='A')
	  {
        printf("T\n");
	  }
	  else if(a[i]=='T')
	  {
        printf("A\n");
	  }
	  else if(a[i]=='G')
	  {
        printf("C\n");

	  }
      else if(a[i]=='C')
	  {
        printf("G\n");
	  }
		}
    }
	  }

	return 0;
}


int main(){
	int n;
	char a[1000];
	scanf("%d",&n);
	for (int i = 0; i < n; i++) {
		scanf("%s",a);
		int len = strlen(a);
		for (int j = 0;j < len; j++){
			char ans;
			switch (a[j]) {
				case 'A': ans = 'T';break;
				case 'T': ans = 'A';break;
				case 'G': ans = 'C';break;
				case 'C': ans = 'G';break;
			}
			printf("%c", ans );
		}
		printf("\n");
	}

}


int main()
{
	int n,i;
	scanf("%d",&n);
	char str[260],*ps;
	int a=0;
	for(i=0;i<n;i++)
	{
		scanf("%s",&str);
		for(ps=str;*ps!='\0';ps++)
		{
			if(*ps=='A')
			*ps='T';
			else if(*ps=='T')
			*ps='A';
			else if(*ps=='C')
			*ps='G';
			else if(*ps=='G')
			*ps='C';
	    }
	    printf("%s\n",str);
    }
	return 0;
}


char pd(char x);
int main(){
char a[256],b[256];
int i,j,l,n;
scanf("%d",&n);
for (i=1;i<=n;i++){
scanf("%s",a);
l=strlen(a);
for (j=0;j<l;j++)
b[j]=pd(a[j]);
b[l]=0;
printf("%s\n",b);
}
return 0;
}
char pd(char x){
char y;
if (x=='A') y= 'T';
if (x=='T') y= 'A';
if (x=='C') y= 'G';
if (x=='G') y= 'C';
return y;
}


int main()
{
	char shuzu[300],*tmp,*tmpa,*tmpt,*tmpc,*tmpg;
	int n,i,j,pp;
	scanf("%d",&n);
	for(i=0;i<n;i++){

		scanf("%s",shuzu);
		pp=strlen(shuzu);
		for(j=0;j<pp;j++){
			        if(shuzu[j]=='A')  shuzu[j]='T';

			        else if(shuzu[j]=='T')  shuzu[j]='A';
			   	    else if(shuzu[j]=='C')  shuzu[j]='G';
					else if(shuzu[j]=='G')  shuzu[j]='C';
		}
		printf("%s\n",shuzu);
	}
	return 0;
}


int main() {
    int i,n;
    char a[260];
	cin >> n;
	while(n > 0){
		scanf("%s",a);
		for(i=0;a[i]!=0;i++){
			switch(a[i]){
			case 'A': a[i] = 'T'; break;
			case 'T': a[i] = 'A'; break;
			case 'C': a[i] = 'G'; break;
			case 'G': a[i] = 'C'; break;
			}
		}
		cout << a <<endl;
		n--;
	}
	return 0;
}


/*
 * c.c
 *
 *  Created on: 2011-10-8
 *      Author: lin
 */

int main()
{
	int t;
	scanf("%d", &t);
	char in[256];
	while(t--)
	{
		scanf("%s", in);
		char *pnt = in;
		while(*pnt)
		{
			switch(*pnt)
			{
			case 'A':
				printf("T");
				break;
			case 'T':
				printf("A");
				break;
			case 'C':
				printf("G");
				break;
			case 'G':
				printf("C");
				break;
			default:
				break;
			}
			pnt++;
		}
		printf("\n");
	}
	return 0;
}


int main()
{
	int i,j,n;
	char a[300];
	cin>>n;
	for(i=0;i<n;i++)
	{
		cin>>a;
		for(j=0;j<strlen(a);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
				a[j]='C';
		}
		cout<<a<<endl;
	}
	return 0;
}


int main(){
	int n;
	scanf("%d",&n);
	char mulian[257];
	char zilian[1000][257];
	int i,j;
	for(i=0;i<n;i++){
		scanf("%s",mulian);
		for(j=0;mulian[j]!='\0';j++){
			if(mulian[j]=='A') zilian[i][j]='T';
			else if(mulian[j]=='T') zilian[i][j]='A';
			else if(mulian[j]=='G') zilian[i][j]='C';
			else zilian[i][j]='G';
		}
		zilian[i][j]='\0';
	}
	int k;
	for(k=0;k<n;k++){
		printf("%s\n",zilian[k]);
	}

	return 0;
}


int main()
{
	int n,count;
	char a[300];
	scanf("%d",&n);
	for (int i=1;i<=n;i++)
	{
		/*for (int j=0,count=0;j<300;j++)
		{
			scanf("%c",&a[j]);
			if(a[j]=='\n')
				break;
			count+=1;
		}*/
		scanf("%s", a);
		for (int m=0;m<strlen(a);m++)
		{
			if(a[m]=='A')
				printf("T");
			if(a[m]=='T')
				printf("A");
			if(a[m]=='C')
				printf("G");
			if(a[m]=='G')
				printf("C");
		}
		printf("\n");
	}
	return 0;
}


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


int main()
{
    int i,n,j,l;
    char yuan[256],bu[256];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",yuan);
        l=strlen(yuan);
        for(j=0;j<=l;j++){
            if(yuan[j]=='A')
               bu[j]='T';
            else if(yuan[j]=='T')
               bu[j]='A';
            else if(yuan[j]=='C')
               bu[j]='G';
            else if(yuan[j]=='G')
               bu[j]='C';
            else bu[j]=yuan[j];
            }
        puts(bu);
        }
    return 0;
}


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


int main()
{
	int n, i, j;
	scanf("%d", &n);
	char input, output;
	scanf("%c", &input);
	for (i=1;i<=n;i++)
	{
		for(j=0;j<255;j++)
		{
			scanf("%c", &input);
			if(input=='A')
			{
				printf("T");
			}
			else if(input=='T')
			{
				printf("A");
			}
			else if(input=='G')
			{
				printf("C");
			}
			else if(input=='C')
			{
				printf("G");
			} else {
				printf("\n");
			}
		}
	}
}


int main()
{
	int i,n,p;
	char a[260];
	scanf("%d",&n);
	scanf("\n");
	for(i=0;i<n;i++)
	{
		p=0;
		do
		{
	    scanf("%c",&a[p]);
		switch(a[p])
		{
		    case 'A': a[p] = 'T'; break;
			case 'T': a[p] = 'A'; break;
			case 'G': a[p] = 'C'; break;
			case 'C': a[p] = 'G'; break;
		}
	    printf("%c",a[p]);
		p=p+1;
		}while(a[p-1]!='\n');
	}
	return 0;
}


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


int main(int argc, char* argv[])
{
	char dna[1000],hubu[1000];
	int n,length;
	scanf("%d",&n);
	for(int i=0;i<n;i++)
	{
		scanf("%s",dna);
		length=strlen(dna);
		for(int j=0;j<length;j++)
		{
			if(dna[j]=='A')
			{
				hubu[j]='T';
			}
			else if(dna[j]=='T')
			{
				hubu[j]='A';
			}
			else if(dna[j]=='G')
			{
				hubu[j]='C';
			}
			else if(dna[j]=='C')
			{
				hubu[j]='G';
			}

	    printf("%c",hubu[j]);}
		printf("\n");
	}

	return 0;
}


int main()
{
int n;
char sr[255];
int i,j,len;
scanf("%d",&n);
char k;
scanf("%c",&k);

for(i=0;i<n;i++)
{
gets(sr);
len=strlen(sr);
for(j=0;j<len;j++)
{
if (sr[j]=='A')
{
sr[j]='T';
}
else if(sr[j]=='T')
{
sr[j]='A';
}
else if(sr[j]=='C')
{
sr[j]='G';
}
else if(sr[j]=='G')
{
sr[j]='C';
}

}
printf("%s\n",sr);
}
return 0;
}


int main()
{
   int n;
   scanf("%d",&n);
   char zfc[256];
   for(int i=0;i<=n;i++){
          gets(zfc);
          for(int j=0;j<strlen(zfc);j++){
                  if(j==strlen(zfc)-1){
                  if(zfc[j]=='A'){
                  printf("T\n");
                                  }
                                    if(zfc[j]=='T'){
                  printf("A\n");
                                  }
                                                    if(zfc[j]=='G'){
                  printf("C\n");
                                  }
                                                    if(zfc[j]=='C'){
                  printf("G\n");
                                  }
                                      }
                                         if(j!=strlen(zfc)-1){
                  if(zfc[j]=='A'){
                  printf("T");
                                  }
                                    if(zfc[j]=='T'){
                  printf("A");
                                  }
                                                    if(zfc[j]=='G'){
                  printf("C");
                                  }
                                                    if(zfc[j]=='C'){
                  printf("G");
                                  }
                                      }

                  }
                  }

   int hou;
   scanf("%d",&hou);
    return 0;
}


int main(int argc, char* argv[])
{
	int n,i,len,j;
	char a[256];
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%s",a);
		len=strlen(a);
		for(j=0;j<len;j++){
			switch(a[j]){
			case 'A':a[j]='T';break;
			case 'C':a[j]='G';break;
			case 'G':a[j]='C';break;
			case 'T':a[j]='A';break;
			}

		}
		printf("%s\n",a);
	}

	return 0;
}


int main()
{
int a,b,c,i,k,m,n;
char sz[300];
scanf("%d",&n);
for(i=0;i<n;i++)
{
scanf("%s",sz);
for(k=0;k<strlen(sz);k++)
{
switch(sz[k])
{
case 'A':
printf("T");
break;
case 'T':
printf("A");
break;
case 'C':
printf("G");
break;
case 'G':
printf("C");
break;
}
}
printf("\n");
}
return 0;
}


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


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


int main() {
	int n;
	int len, i;
	char s[300];
	scanf("%d", &n);
	while(n--) {
		scanf("%s", s);
		len = strlen(s);
		for(i=0; i<len; i++)
			switch(s[i]) {
				case 'A': printf("T");break;
				case 'T': printf("A");break;
				case 'G': printf("C");break;
				case 'C': printf("G");break;
			}
		printf("\n");
	}

	return 0;
}


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

	return 0;
}


void dnapair(char*str)
{
int p=0;
while(str[p]!='\0')
{
switch(str[p]){
case'A':str[p++]='T';break;
case'T':str[p++]='A';break;
case'C':str[p++]='G';break;
case'G':str[p++]='C';break;
}}
}
int main(){
int n;
char str[1221];
scanf("%d",&n);
for(int i=0;i<n;i++){
scanf("%s",str);
dnapair(str);
printf("%s\n",str);
}
return 0;
}


int main()
{
int n,i,j;
char c;
scanf("%d",&n);
c=getchar();
for(i=0;i<n;i++)
{
for(j=0;;j++)
{
c=getchar();
if(c=='A'){printf("T");continue;}
if(c=='C'){printf("G");continue;}
if(c=='T'){printf("A");continue;}
if(c=='G'){printf("C");continue;}
if(c=='\n'){printf("\n");break;}

}
}
}


int main()
{
	int n,i,j;
	//char lian[100][256],hubu[100][256];
	char **lian, **hubu;
	scanf("%d",&n);
	lian = (char**)malloc(n*sizeof(char*));
	hubu = (char**)malloc(n*sizeof(char*));
	for(i=0; i<n; i++)
	{
		lian[i] = (char*)malloc(256*sizeof(char));
		hubu[i] = (char*)malloc(256*sizeof(char));
	}
	for(i=0;i<n;i++)
	{
		scanf("%s",lian[i]);
	}
	for(i=0;i<n;i++)
	{
		for(j=0;lian[i][j]!='\0';j++)

		{
			if(lian[i][j]=='A')
			{
				hubu[i][j]='T';
			}
			if(lian[i][j]=='T')
			{
				hubu[i][j]='A';
			}
            if(lian[i][j]=='G')
			{
				hubu[i][j]='C';
			}
			if(lian[i][j]=='C')
			{
				hubu[i][j]='G';
			}
		}
		hubu[i][j]='\0';
	}
	for(i=0; i<n; i++)
		printf("%s\n",hubu[i]);
	return 0;
}


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


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

	}
			for(i=0;i<n;i++)
			{
				printf("%s\n",jianji[i]);
			}

	return 0;
}


int main()
{
	int n;
	char base[20000][300];
	int i,j;
	scanf("%d",&n);
	for (i=0;i<n;i++)
	{
		scanf("%s",base[i]);
		for (j=0;base[i][j]!=0;j++)
		{
			switch (base[i][j])
			{
			    case 'A':
					{
						base[i][j]='T';
						break;
					}
				case 'T':
					{
						base[i][j]='A';
						break;
					}
				case 'G':
					{
						base[i][j]='C';
						break;
					}
				case 'C':
					{
						base[i][j]='G';
						break;
					}
			}
		}
	}
	for (i=0;i<n;i++)
	{
		printf("%s\n",base[i]);
	}
	return 0;
}


int main()
{
    int n,i,j;
	char c[256];
	scanf("%d",&n);
	for(i=1;i<=n;i++)
	{

	    scanf("%s",c);
		for(j=0;j<strlen(c);j++)
		{
              if(c[j]=='A')
			  {
				  c[j]='T';
				  continue;
			  }
			  if(c[j]=='T')
			  {
				  c[j]='A';
				  continue;
			  }
			  if(c[j]=='C')
			  {
			      c[j]='G';
				  continue;
			  }
			  if(c[j]=='G')
			  {
                  c[j]='C';
				  continue;
			  }
		}
			printf("%s",c);
		printf("\n");
	}
	return 0;
}


void main()
{
	int n;
	char c;
	scanf("%d",&n);
	getchar();
	for(;n>0;n--){
		c=getchar();
		while(c!='\n'){
			switch(c){
			case 'A': putchar('T');break;
			case 'T': putchar('A');break;
			case 'C': putchar('G');break;
			case 'G': putchar('C');break;
			default: break;
			}
			c=getchar();
		}
		putchar('\n');
	}
}


int main()
{
int n;
char sz[100000];
scanf("%d",&n);
getchar();
for(int i=0;i<n;i++)
 {
   gets(sz);
    for(int j=0;sz[j];j++)
     {if(sz[j]=='A') sz[j]='T';
      else if(sz[j]=='T') sz[j]='A';
           else if(sz[j]=='G') sz[j]='C';
                else if(sz[j]=='C') sz[j]='G';}
   puts(sz);
 }
return 0;
}


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

  }

return 0;
}


int main(){
	int n,len;
	char zf[1000][1000];
	scanf("%d",&n);
	int i,j;
	for (i=0;i<n;i++){
		scanf("%s",zf[i]);
		j=0;
		len=strlen(zf[i]);
		for (j=0;j<len;j++){
			switch(zf[i][j]){
			case 'A':
				zf[i][j]='T';
				break;
			case 'T':
				zf[i][j]='A';
				break;
			case 'C':
				zf[i][j]='G';
				break;
			case 'G':
				zf[i][j]='C';
				break;
			}
		}
		printf("%s\n",zf[i]);
	}
	return 0;
}


int main() {
	int i,j, n;
	char zfc[LEN][LEN];
	scanf("%d", &n);
	for(j=0;j<n;j++){
		scanf("%s", zfc[j]);
	}
	for(j=0;j<n;j++){
		for(i=0; zfc[j][i]!=0; i++) {
			switch(zfc[j][i]) {
			case 'A':
				zfc[j][i] = 'T';
				break;
			case 'T':
				zfc[j][i] = 'A';
				break;
			case 'C':
				zfc[j][i] = 'G';
				break;
			case 'G':
				zfc[j][i] = 'C';
				break;
			}
		}
		printf("%s\n", zfc[j]);
	}
	return 0;
}


int main()
{
	int n, i, l;
	char str[256], *p = NULL;
	cin >> n;
	for (i = 0; i < n; i++)
	{
		cin >> str;
		l = strlen(str);
		for (p = str; p < str + l; p++)
		{
			if (*p == 'A')
				cout << 'T';
			else if (*p == 'T')
				cout << 'A';
			else if (*p == 'C')
				cout << 'G';
			else
				cout << 'C';
		}
		cout << endl;
	}
	return 0;
}


int main(){
	int n;
	scanf("%d",&n);
	char str[256];
	char o,p,q,r;
	o='T';
	p='A';
	q='C';
	r='G';
	int i,j;
	int len;
	for(i=0;i<n;i++){
		scanf("%s",str);
		len=strlen(str);
		for(j=0;j<len;j++){
			if(str[j]=='A')
				printf("%c",o);
			else if(str[j]=='T')
				printf("%c",p);
			else if(str[j]=='C')
				printf("%c",r);
			else printf("%c",q);
		}
		printf("\n");
	}

	return 0;
}


int main()
{
	char jianji[1000][256];
	int n,i,k,m;
	scanf("%d",&n);

		for(i=0;i<n;i++){
scanf("%s",&jianji[i]);
		}
		for(i=0;i<n;i++){
		m=strlen(jianji[i]);
		for(k=0;k<m;k++){
			if(jianji[i][k]=='A'){
				jianji[i][k]='T';
			}else{
				if(jianji[i][k]=='T'){
				jianji[i][k]='A';
				}else{
					if(jianji[i][k]=='C'){
				jianji[i][k]='G';
					}else{
						if(jianji[i][k]=='G'){
				jianji[i][k]='C';
		}
	}
		}
			}
		}
		}
				for(i=0;i<n;i++){
		printf("%s\n",jianji[i]);
				}

return 0;
}


int main()
{
	int i,j,len,n;
	char ch,str[1000];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		scanf("%s",str);
		len=strlen(str);
		for(j=0;j<len;j++)
		{

			switch(str[j])
			{
			case 'A':
				str[j]='T';
				break;
			case 'T':
				str[j]='A';
				break;
			case 'C':
				str[j]='G';
				break;
			case 'G':
				str[j]='C';
				break;
			}
		}
		printf("%s",str);
                printf("\n");

	}
	return 0;
}


int main()
{
	int n,i,j;
	int LEN;
	scanf("%d",&n);
	getchar();
	for ( i = 0 ; i < n ; i ++)
	{
		char s[1000];
		gets(s);
		LEN = strlen(s);
		for ( j = 0 ; j < LEN ; j ++)
		{
			switch ( s[j] )
			{
			case 'A':
				printf("T");
				break;
			case 'T':
				printf("A");
				break;
			case 'C':
				printf("G");
				break;
			case 'G':
				printf("C");
				break;
			}
		}
		if( i < n-1)
			printf("\n");
	}
	return 0;
}


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;
	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[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;
}


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 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 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;
	}


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);
}


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;
}


//
//  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 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 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;
}


/*
 * 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;
  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);
}


main()
{
      int i,a;
      scanf("%d",&i);
      while(i!=1)
      {
                 if (i==1) break;
                 else if(i%2)
                 {a=3*i+1;
                 printf("%d*3+1=%d\n",i,a);
                 i=a;
                 continue;}
                 else
                 {
                 a=i/2;
                 printf("%d/2=%d\n",i,a);
                 i=a;
                 }

                 }
                 printf("End");
                 getchar();
                 getchar();
                 getchar();
}


int main()
{
 int inta=0,i,a=0,b=0;//inta????????i?????
	  cin>>inta;
	  for(i=0;;i++)
	  {
		  if(inta%2==0)
		  {

			  a=inta/2;
			  cout<<inta<<"/2="<<a<<endl;
			  inta=a;
		  }

		  if(inta%2!=0&&inta!=1)
		  {

			  b=inta*3+1;
			  cout<<inta<<"*3"<<"+1="<<b<<endl;
			  inta=b;
		  }

		  if(inta==1)
		  {
			  break;

		  }

	  }

cout<<"End";

   cin.get();cin.get();cin.get();cin.get();
   return 0;
}


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


void verify(int n)
{
	if(n!=1)
	{
		if(n%2==1)
			cout<<n<<"*3+1="<<n*3+1<<endl;
		else
			cout<<n<<"/2="<<n/2<<endl;
		verify((n%2==1? n*3+1:n/2));
	}
	else cout<<"End";
}
int main()
{
	int m;
	cin>>m;
	verify(m);
	return 0;
}


int main()
{int a,n,i;
scanf("%d",&n);

for(i=0;i<100;i++)
{ if(n==1)
{printf("End");
break;}

else
{
if (n%2==0)
{a=n/2;

printf("%d/2=%d\n",n,a);
n=a;
continue;}
else if(n%2==1)
{
a=n*3+1;}
printf("%d*3+1=%d\n",n,a);
n=a;
continue;}}

	return 0;
}


int main( )
{
	int num,m;
	cin>>num;
	while(num!=1)
	{
		m=num;
		if(num%2==0)num=num/2,cout<<m<<"/"<<"2="<<num<<endl;
		else num=num*3+1,cout<<m<<"*3+1="<<num<<endl;
	}
	cout<<"End";
    return 0;
}


void run(int x){
	int lt;
	if(x==1){
		printf("End");
	}
	else if(x%2){
		lt=x*3+1;
		printf("%d*3+1=%d\n",x,lt);
		run(lt);
	}
	else if(x!=2){
		lt=x/2;
		printf("%d/2=%d\n",x,lt);
		run(lt);
	}
	else{
		printf("2/2=1\nEnd");
	}
}
int main(){
	int a;
	cin>>a;
	run(a);

}


void count(int n)
{
	int a,b,i,j;
	if(n==1)printf("End\n");
	else
	{
		if(n%2!=0)
		{
			a=n*3+1;
			printf("%d*3+1=%d\n",n,a);
			n=a;
			count(n);
		}
		else
		{
			b=n/2;
			printf("%d/2=%d\n",n,b);
			n=b;
			count(b);
		}
	}
}

void main()
{
	int n;
	scanf("%d",&n);
	count(n);

}


int isjishu(int x);
int isoushu(int y);
int main()
{
	int n;

	scanf("%d",&n);
	for(;;)
	{
		if(n==1) break;
		if(n%2==0) n=isoushu(n);
		else n=isjishu(n);

	}
	printf("End");
	return 0;
}

int isjishu(int x)
{
	int temp1=x;
	x=x*3+1;
	printf("%d*3+1=%d\n",temp1,x);
	return x;
}
int isoushu(int y)
{
	int temp2=y;
	y=y/2;
	printf("%d/2=%d\n",temp2,y);
	return y;
}


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


int main()
{
  void jiaogu(int n);
  int m;
  scanf("%d",&m);
  jiaogu(m);
}

void jiaogu(int n)
{
   void shizi(int x);
   if(n==1)
   printf("End");
   if(n%2==0)
   {shizi(n);
    jiaogu(n/2);}
   if(n%2!=0&&n!=1)
   {shizi(n);
   jiaogu(n*3+1);}

}
void shizi(int x)
{  int y;
   if(x%2==0)
   {y=x/2;
   printf("%d/2=%d\n",x,y);}
  if(x%2!=0)
  {y=(x*3+1);
   printf("%d*3+1=%d\n",x,y);}
}


int main()
{
	int a,b,d;
	float c;
	scanf("%d",&a);
	while(a>1)
	{
		b=a%2;
		d=a*3+1;
		c=(float)a/2;
		if(b==1)
		printf("%d*3+1=%d\n",a,d);
		else if(b==0)
		    printf("%d/2=%.0f\n",a,c);
		if(b==1) a=d;
		else a=c;
	}
	printf("End");
}


void main()
{
	int n;
	scanf("%d",&n);
	void print1(int n);
	void print2(int n);
	int printf1(int n);
	int printf2(int n);
	if(n==1)printf("End\n");
	else
	{
		int i;
		for(;n!=1;)
		{
			if(n%2==0)
			{
				print1(n);
				n=printf1(n);
			}
			else
			{
				print2(n);
				n=printf2(n);
			}
		}
		printf("End\n");
	}
}
int printf1(int n)
{
	int m;
	m=n/2;
	return m;
}
void print1(int n)
{
	printf("%d/2=%d\n",n,n/2);
}
int printf2(int n)
{
	int m;
	m=n*3+1;
	return m;
}
void print2(int n)
{
	printf("%d*3+1=%d\n",n,n*3+1);
}


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


int f1( int );//??
int f2( int );//??
void opration( int ) ;//??????
int main()//????
{
	int n ;
	cin >> n ;
	opration( n ) ;

	return 0 ;
}
int f1( int n )
{
	return n*3+1 ;
}
int f2( int n )
{
	return n/2 ;
}
void opration( int n )
{
	while ( n != 1 )
	{
		if ( n % 2 == 1 )
		{
			cout << n << "*3+1=" << f1(n) << endl ;
			n = f1(n) ;
		}
		else
		{
			cout << n << "/2=" << f2(n) << endl ;
			n = f2(n) ;
		}
	}
	cout << "End" ;
}
// ( > w < ) finished~


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


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


int Is_OddNumber(int x);

int main()
{
	int number, result, mark;
	cin >> number;
	result = number;    // ??????
	if (number== 1)
	{
		cout << "End";
	}
	else{
	do
	{   int Is_OddNumber(int x);
        int f = Is_OddNumber(result);
		if (f == 0)       // ??f?0???number???
		{
            mark = result;
			result = result / 2;
			if (result != 1)
			{
				cout << result * 2 << "/2=" << result << endl;
			}
		}
		else
		{
			mark = result;
			result = result * 3 + 1;
			if (result != 1)
			{
				cout << (result - 1) / 3 << "*3+1=" << result << endl;
			}

		}
	} while (result != 1);
	if (mark == 2)
	{
		cout << "2/2=1" << endl;
	}
	else
	{
		cout << "0*3+1=1" << endl;
	}
    if (result == 1)
	{
		cout << "End";
	}
	}
    return 0;
}

int Is_OddNumber(int x)
{
	int f;
	if ( x % 2 == 0)
	{
		f = 0;
	}
	else
	{
		f = 1;
	}
	return f;
}


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


/*
 * 247.cpp
 *
 *  Created on: 2011-12-22
 *      Author: think
 */
int jishu(int n){
	cout<<n<<"*3+1="<<3*n+1<<endl;
	return 3*n+1;
}
int oushu(int n){
	cout<<n<<"/2="<<n/2<<endl;
	return n/2;
}
int main(){
	int n;
	cin>>n;
	for(;n!=1;){
		if(n%2!=0){
			n=jishu(n);
		}
		else n=oushu(n);
	}
	cout<<"End"<<endl;
	return 0;
}


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


    int main()
    {
        int n;
        int func(int n);
        scanf("%d",&n);
        if(n==1) printf("End");
        else {func(n);printf("End");}

        return 0;
    }
    int func(int n)
    {
        if(n%2==0) {n=n/2;printf("%d/2=%d\n",2*n,n);}
        else {n=3*n+1;printf("%d*3+1=%d\n",(n-1)/3,n);}
        if(n!=1) func(n);
    }


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


int main()
{
	int n,a=0,b=0;
	cin>>n;
	if(n==1)
		cout<<"End"<<endl;
	else
	{
		while(n!=1)
		{
			if(n%2!=0)
			{
				cout<<n<<"*3+1=";
				n=n*3+1;
				cout<<n<<endl;
			}
			else
			{
				cout<<n<<"/2=";
				n=n/2;
				cout<<n<<endl;
			}
		}
		cout<<"End"<<endl;
	}
		return 0;
}


int print1(int q)
{int r;
r=q*3+1;
	printf("%d*3+1=%d\n",q,r);
	return(r);
}

int print2(int q)
{int r;
r=q/2;
	printf("%d/2=%d\n",q,r);
	return(r);
}

void main()
{
	int q;
	scanf("%d",&q);
	do
	{
        if(q==1)break;
		if((q%2)==1)
			q=print1(q);
		if((q%2)==0)
			q=print2(q);
	}while(q!=1);
	printf("End");
}


int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	while (1)
	{
		if(n==1)
		{
			printf("End\n");
			break;
		}
		else
		{
		   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;
		   }
		}
	}

	return 0;
}


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


int p;
int oushu(int a)
{
	p=a/2;
	cout<<a<<"/2="<<p<<endl;
	return p;
}
int jishu(int a)
{
	p=a*3+1;
	cout<<a<<"*3+1="<<p<<endl;
	return p;
}
int main()
{
	int a;
	cin>>a;
	while(a!=1)
	{
		if(a%2==0)
		{
			oushu(a);
			a=p;
		}
		else
		{
			jishu(a);
			a=p;
		}
	}
	cout<<"End";
	return 0;
}


//#include<string.h>
int change(int n)
{
	int x;
	if(n==1) x=1;
	else {
		if((n%2)==0) {x=n/2;
		printf("%d/2=%d\n",n,x);}
		else {x=n*3+1;
		printf("%d*3+1=%d\n",n,x);}
	}
	return(x);
}

void main()
{
	int n,k=0;
	scanf("%d",&n);
	//if(n==1) printf("End");
	k=change(n);
	while(k!=1)
	{
		k=change(k);
	}
	printf("End");
}


main()
{
      int a,b,c;
      scanf("%d",&a);
      while(a>=2)
      {
                     if(a%2==1)
                     {b=3*a+1;
                     printf("%d*3+1=%d\n",a,b);
                     c=b;a=c;a=b;
                     continue;
                     }
                     else
                     {b=a/2;
                     printf("%d/2=%d\n",a,b);
                     c=b;a=c;a=b;
                     continue;}
                     }

                     printf("End\n");

      }


int wer(int a)
{
      int n,i;
      n=a%2;
     if(n==1)
          i=3*a+1;
     else
          i=a/2;
     return i;
}
int main()
{
     int a;
     scanf("%d",&a);
if(a==1)
printf("End");
else
{
     for(;;)
     {
     if(a%2==1)
     {
                    printf("%d*3+1=%d\n",a,wer(a));
                     a=wer(a);
     }
     else
            {
                    printf("%d/2=%d\n",a,wer(a));
                    a=wer(a);
            }
      if(a==1)
      {printf("End");
      break;
      }}}
}


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


int step(int k)
{
    if (k == 1) {
        return 0;
    } else if (k % 2 == 0) {
        k /= 2;
        printf("%d/2=%d\n", k * 2, k);
    } else {
        k = k * 3 + 1;
        printf("%d*3+1=%d\n", (k - 1) / 3, k);
    }
    return step(k);
}

int main()
{
    int n;
    scanf("%d", &n);
    step(n);
    printf("End");
    return 0;
}


//????
int guess(int num)
{
    if(num==1)
    {
        cout<<"End"<<endl;
        return 1;
    }
    if(num!=1)
    {
        if(num%2==0)
        {
            cout<<num<<"/2="<<num/2<<endl;
            return guess(num/2);
        }
        if(num%2!=0)
        {
            cout<<num<<"*3+1="<<3*num+1<<endl;
            return guess(3*num+1);
        }
    }
}
int main()
{
    int n=0;
    cin>>n;
    guess(n);
    return 0;
}


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


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

	if(n%2==0)
		oushu(n);
	else qishu(n);
	}
}


int main ()
{
	int number=0,x=0;
	cin >>number;
	while (number!=1)                                                          //??while?????1????
	{
		if (number%2==1)                                                       //??????
		{
			x=number;
		    number=number*3+1;
			cout <<x <<"*3+1=" <<number <<endl;
		}
		else                                                                   //??????
		{
			x=number;
			number=number/2;
			cout <<x <<"/2="<<number <<endl;
		}
    }
	cout <<"End";                                                              //??End??

	return 0;
}


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

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


/*
 * jiaogu.cpp
 *
 *  Created on: 2011-12-23
 *      Author: 11161
 */

int jiaogu(int n)
{ int result;
	if(n%2==1)
	{result=n*3+1;
		cout<<n<<"*3+1="<<result<<endl;
	}
	else
	{
		result=n/2;
		cout<<n<<"/2="<<result<<endl;
	}
	return result;
}
int main()
{
	int n,num;
	cin>>n;
	if(n==1){cout<<"End"<<endl;return 0;}
	else
	num=n;
	while(1)
	{
		num=jiaogu(num);
		if(num==1)break;
	}
	cout<<"End"<<endl;

}


int outcome(int n)
{
	int t;
	if (n%2==0)
		t=n/2;
	else t=3*n+1;
	return (t);
}
void main()
{
	int n,t,i;
	scanf("%d",&n);
	t=n;
	for(i=0;t!=1;i++)
	{
	    if (t%2==0)
			printf("%d/2=%d\n",t,outcome(t));
		else
		    printf("%d*3+1=%d\n",t,outcome(t));
		t=outcome(t);
	}

	printf("End");
}


void result(int a,int b)
{
	if(a==1)
		cout<<"End"<<endl;
	else if(a%2==1)
	{
		cout<<a<<"*3+1="<<a*3+1<<endl;
		result(a*3+1,a);

	}
	else if(a%2==0)
	{
		cout<<a<<"/2="<<a/2<<endl;
		result(a/2,a);

	}
}

int main()
{
	int a;
	cin>>a;
	result(a,a);
	return 0;
}


void ji(int m)
{
	cout<<m<<"*3+1="<<m*3+1<<endl;
}
void ou(int m)
{
	cout<<m<<"/2="<<m/2<<endl;
}
void f(int m)
{
	if(m==1) ;
	else{
	if(m%2==0)
		{
			ou(m);
			f(m/2);
	}
	else
		{
			ji(m);
			f(m*3+1);
	}
	}
}
int main()
{
	int n;
	cin>>n;
	f(n);
	cout<<"End"<<endl;
	return 0;
}


int main(){
	int n,i;
	scanf("%d ",&n);
	for(i=1;i>0;i++){
		if(n==1){
			printf("End");
			break;
		}
		if(n%2==0){
			n=n/2;
			printf("%d/2=%d\n",2*n,n);
			continue;
		}else{
			printf("%d",n);
			n=n*3+1;
			printf("*3+1=%d\n",n);
			continue;
		}
	}
	return 0;
}


int main(int argc, char* argv[])
{
	int a,b,c;
	scanf("%d",&a);
	if(a==1)
		printf("End");
	else
	{
	do
	{
		if(a%2==0)
		{
			b=a/2;
			printf("%d/2=%d\n",a,b);
		}
		else
		{
			b=a*3+1;
		printf("%d*3+1=%d\n",a,b);
		}
		a=b;
	}
	while(a!=1);
	printf("End");
	}
	return 0;
}


int move(int i)
{int j=i/2,k=i*3+1;
	if(i==1)
printf("End");
else if(i%2==0)
{
printf("%d/2=%d\n",i,j);
return(j);
}
else
{
printf("%d*3+1=%d\n",i,k);
return(k);
}
}
void hanoi(int n)
{int z;
	if(n==1)
move(n);
else
{z=move(n);
hanoi(z);
}
}
void main()
{
	int a;
scanf("%d",&a);
hanoi(a);
}


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


int main(){
	int n;
	int m;
	scanf("%d",&n);
	int i;
	for(i=0;i<MAX;i++){
		if(n!=1){
			if(n%2!=0){
				m=n*3+1;
				printf("%d*3+1=%d\n",n,m);
				n=m;
			}else{
				m=n/2;
				printf("%d/2=%d\n",n,m);
				n=m;
			}
		}else{
			printf("End");
			break;
		}
	}

	return 0;
}


int main()
{
	int n=0,result=0,i=0;
	scanf("%d",&n);
	for(i=1;1;i++)
	{
		if(n==1)
		{
			printf("End\n");
			break;
		}
		if(n%2==0)
		{
			result=n/2;
			printf("%d/2=%d\n",n,result);
			n=result;
		}else if(n%2==1){
			result=n*3+1;
			printf("%d*3+1=%d\n",n,result);
			n=result;
		}

	}
	return 0;
}


main()
{
      int a,b;
      scanf("%d",&a);
     loop:if(a==1)
     {
     printf("End");
     getchar();
     getchar();
     return 0;
     }
     else if(a%2!=0)
      {
       {
                 b=a*3+1;
       }
       printf("%d*3+1=%d\n",a,b);
       a=b;
      }
      else if(a%2==0)
      {
       {
           b=a/2;
       }
       printf("%d/2=%d\n",a,b);
       a=b;
      }
      goto loop;
}


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


int main()
{
    int num;
    cin>>num;
    if(num>1)
    for(int i=0;;i++){
    if(num%2==1)
    {
    cout<<num;
    num=num*3+1;
    cout<<"*3+1="<<num<<endl;
    }
    if(num%2==0)
    {
    cout<<num;
    num=num/2;
    cout<<"/2="<<num<<endl;
    if(num==1)
    break;
    }
    }
    if(num==1)
  cout<<"End"<<endl;
    return 0;
}


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

}


void jg(int a)
{
       int t =0;
	if (a==1) cout<<"End";
	else if (a%2==1)
	{
		t=a*3+1;
	cout<<a<<"*3+1="<<t<<endl;
		jg(t);
		}
		else
		{
			t=a/2;
			cout<<a<<"/2="<<t<<endl;
			jg(t);
		}
	}

int main()
{
	int a=0;
	cin>>a;
	jg(a);
	return 0;
	}


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


main()
{
      int n,a=3,b=1,c=2,s;
      scanf("%d",&n);
      while(n!=1)
      {
                 if(n%2==1)
                 {
                           s=n*a+b;
                 printf("%d*%d+%d=%d\n",n,a,b,s);
                 }
                 else
                 {
                     s=n/c;
                 printf("%d/%d=%d\n",n,c,s);
                 }
                 n=s;
      }
      printf("End");
      getchar();
      getchar();
}


/*
 * qimofuxi_03.cpp
 *  ???????
 *  Created on: 2010-12-17
 *      Author: william
 */
int operation(int x)
{
	if(x%2==0)
    {
		cout<<x<<"/2="<<x/2<<endl;
		return x/2;
    }
	else
	{
		cout<<x<<"*3+1="<<3*x+1<<endl;
		return 3*x+1;
	}
}
int main()
{
    int x;
    cin>>x;
    for(;x!=1;)
    {
    	x=operation(x);
    }
    cout<<"End";
    return 0;
}


main()
{
int a,b,e;
scanf ("%d",&a);if (a==1) {printf ("End");goto loop_copperhead;}
loop_cobra:
e=a-(int)(a/2)*2;
if (e==0) {printf ("%d/2=%d\n",a,a/2); a=a/2;}
else {b=a*3+1;printf("%d*3+1=%d\n",a,b);a=b;}
if (a!=1) goto loop_cobra; else printf ("End");
loop_copperhead:
return 0;
}


/*
 * qimolianxi_3.cpp
 * Name:????
 *  Created on: 2010-12-24
 *      Author: ??
 */

void os(int o);
void js(int j) {
	int n = j * 3 + 1;
	cout << j << "*" << 3 << "+" << 1 << "=" << n << endl;
	if(n%2==0) os(n);
	else {
		if(n!=1) js(n);
		else cout<<"End"<<endl;
	}
}
void os(int o) {
	int m = o / 2;
	cout << o << "/" << 2 << "=" << m << endl;
	if(m%2==0) os(m);
	else{
		if(m!=1) js(m);
		else cout<<"End"<<endl;
	}
}
void progress(int t) {
	if(t==1){
		cout<<"End"<<endl;
		return;
	}
	if (t != 1 && t % 2 == 1)
	js(t);
	if (t % 2 == 0)
	os(t);
}
int main() {
	int t;
	cin >> t;
	progress(t);
	return 0;
}


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


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

int change(int n)
{
	int a;
	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);
	}
	return a;
}


void main()
{
	int n;
	void suan(int a);
	scanf("%d",&n);
    suan(n);

}
void suan(int a)
{
	int s;
    if(a==1)
		printf("End");
	else if(a%2==0)
	{
		s=a/2;
		if(s!=1)
		{
			printf("%d/2=%d\n",a,s);
		suan(s);
		}
		else
		{   printf("%d/2=%d\n",a,s);
		printf("End");}

	}
	else if(a%2!=0)
	{
		s=a*3+1;
		printf("%d*3+1=%d\n",a,s);
		suan(s);
	}
}


void fenjie(int n)
{
 if(n==1)
 {printf("End");
 return;}
 int m=0;
 if(n%2==0)
 {m=n>>1; printf("%d/2=%d\n",n,m);}
 else{m=3*n+1;printf("%d*3+1=%d\n",n,m);}
 fenjie(m);
}
int main()
{
int n;
cin>>n;
fenjie(n);

   return 0;

}


void gujiao(int x)
{
	if(x%2)
	{
		printf("%d*3+1=%d\n",x,x*3+1);
		x=x*3+1;
	}
	else
	{
		printf("%d/2=%d\n",x,x/2);
		x=x/2;
	}
	if(x==1) printf("End");
	else gujiao(x);
}

int main()
{
	int n,i;
	scanf("%d",&n);
	if(n==1) {printf("End");return 0;}
	else gujiao(n);
	return 0;
}


int jiaogu(int n)
{
	if(n==1)
	{
	  printf("End\n");
	  return 0;
	}
	else if(n%2)
	{
	  printf("%d%c%d%c%d%c%d\n",n,42,3,43,1,61,n*3+1);
	  n=n*3+1;
	  jiaogu(n);
	  return 0;
	}
	else
	{
	  printf("%d%c%d%c%d\n",n,47,2,61,n/2);
	  n=n/2;
	  jiaogu(n);
	  return 0;
	}
}

int main()
{
	int n;
	scanf("%d",&n);
	jiaogu(n);
	return 0;
}


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

    while (a>1);

    printf("End");
}
    getchar();
    getchar();
}


int i;
void Kakutan()
{
    while(i!=1)
    {
        if(i%2==1)
        {
            cout<<i<<"*3+1="<<i*3+1<<endl;
            i=i*3+1;
        }
        else
        {
            cout<<i<<"/2="<<i/2<<endl;
            i=i/2;
        }
    }
    if(i==1)cout<<"End"<<endl;
    return;
}
int main()
{
    cin>>i;
    Kakutan();
    return 0;
}


void ji(int shu){
	int m;
	m=shu*3+1;
	cout<<shu<<"*3+1="<<m<<endl;
	void ou(int shu);
	if (m%2==1) ji(m);
	else ou(m);
}

void ou(int shu){
	int m;
	m=shu/2;
	cout<<shu<<"/2="<<m<<endl;
	if (m==1) cout<<"End";else
	if (m%2==1) ji(m);
	else ou(m);
}

int main(){
	int n;
	cin>>n;
        if (n==1) cout<<"End";else
	if (n%2==1) ji(n);
	else ou(n);
}


int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	for (;;)
	{
		if (n==1)
		{
			printf("End\n");
			break;
		}
		else if(n%2==1)
		{
			printf("%d*3+1=%d\n",n,(3*n+1));
			n=3*n+1;
			continue;
		}
		else if (n%2==0)
		{
			printf("%d/2=%d\n",n,(n/2));
			n=n/2;
			continue;
		}
	}
	return 0;
}


int CalcAndPrint(int x)
{
	int result;
	if (x % 2 == 0)
	{
		result = x / 2;
		cout << x << "/2=" << result << endl;
	}
	else
	{
		result = x * 3 + 1;
		cout << x << "*3+1=" << result << endl;
	}
	return result;
}

int main()
{
	int num;
	for (cin >> num; num != 1; num = CalcAndPrint(num));
	cout << "End";
	return 0;
}


void Try(int);
int main()
{
    int n;
    cin >> n;
    Try (n);
    cout << "End" << endl;
    return 0;
}
void Try(int i)
{
     while (i != 1)
     {
             if (i % 2 == 0)
             {
                   cout << i << "/2=" << i / 2 << endl;
                   i = i / 2;
             }
             else
             {
                 cout << i  << "*3+1=" << i * 3 + 1<< endl;
                 i = i * 3 + 1;
             }
     }
}


int suan(int n)
{
	int temp;
	if(n==1)
	{
		printf("End");
	   return 0;
	   }
	if(n%2==1)
	{
		temp=n;
		n=n*3+1;
		printf("%d*3+1=%d\n",temp,n);
		return suan(n);
	}
	if(n%2==0)
	{
		temp=n;
		n=n/2;
		printf("%d/2=%d\n",temp,n);
		return suan(n);
	}

}

void main()
{
	int n;
	scanf("%d",&n);
	suan(n);
}


int num;

void func(){
  if (num & 1) {
    cout << num << "*3+1=" << num * 3 + 1 << endl;
    num = num * 3 + 1;
  }
  else {
    cout << num << "/2=" << num / 2 << endl;
    num /= 2;
  }
}

int main(){
  cin >> num;
  while (num != 1){
    func();
  }
  cout << "End" << endl;

  return 0;
}


void gj(int k)
{
  int i,j,m;
  if(k==1)
  {
   printf("End\n");
   return;
  }
  if(k%2==1)
  {
    printf("%d*3+1=%d\n",k,3*k+1);
	gj(3*k+1);
  }
  else
  {
    printf("%d/2=%d\n",k,k/2);
	gj(k/2);
  }
}

int main()
{
  int k;
  scanf("%d",&k);
  gj(k);
  return 0;
}


void main()
{
	void cai(int m);
	int n,i=0,j=0,k=0,s;
    scanf("%d",&n);
	cai(n);
}

void cai(int m)
{
	int t;
	if(m==1)
	{
		printf("End");
		return;
	}
	if(m%2==0)
	{
		t=m/2;
		printf("%d/2=%d\n",m,t);
	    cai(t);
	}
	if(m%2==1)
	{
		t=m*3+1;
		printf("%d*3+1=%d\n",m,t);
		cai(t);
	}
}


/*
 * jiaogucaixiang.cpp
 *
 *  Created on: 2013-11-16
 *      Author: dyx
 */
int oushu(int n)
{
	int a=n/2;
	cout << n <<"/2="<<a<<endl;
	return a;
}
int jishu(int n)
{
	int a=3*n+1;
	cout << n<<"*3+1="<<a<<endl;
	return a;
}
int main()
{
	int n;
	cin>> n;
	while(1)
	{
		if(n==1)
		{
			cout << "End";break;
		}
		if(n%2==0)
			n=oushu(n);
		else
			n=jishu(n);

	}
return 0;
}


int main()
{
	int a,b,c,i;
	scanf("%d",&a);
	if(a!=1){
	for(i=0;i<1000;i++){
	 if(a%2==0){
	    b=a/2;
	    printf("%d/2=%d\n",a,b);
	    a=b;
	 }
	 else{
	    c=a*3+1;
	    printf("%d*3+1=%d\n",a,c);
	    a=c;
	 }
	if(a==1)
		break;
	else
		continue;
	}
	    printf("End");
	}
	else
		printf("End");
	return 0;
}


int main()
{
	int a;
	cin>>a;
	if (a==1)
	{
		cout<<"End"<<endl;
	}
	else
	{
		do
		{
			if (a%2==0)
			{
			    cout<<a<<"/2=";
			    a=a/2;
			    cout<<a<<endl;
			}
		    else
			{
			    cout<<a<<"*3+1=";
			    a=a*3+1;
			    cout<<a<<endl;
			}
		}while (a>1);
	    cout<<"End"<<endl;
	}
return 0;
}


main()
{
      int N,a;
      int odd(int x);
      int even(int x);
      scanf("%d",&N);
      while(N!=1)
      {

           if(N%2==1)
           {
                     a=N;
                     N=odd(N);
                     printf("%d*3+1=%d\n",a,N);
           }
           else
           {
                     a=N;
                     N=even(N);
                     printf("%d/2=%d\n",a,N);
           }
      }
      printf("End\n");

            }

int odd(int x)
{
    int z;
    z=3*x+1;
    return z;
    }

int even(int x)
{
    int y;
    y=x/2;
    return y;
    }


void calcu(int k);
int main()
{
	int n;
	cin>>n;
	if(n==1)
		cout<<"End"<<endl;
	else
		calcu(n);
	return 0;
}

void calcu(int k)
{
	if(k%2==0)
	{
		cout<<k<<"/2="<<(k/2)<<endl;
		if(k/2==1)
			cout<<"End"<<endl;
		else
			calcu(k/2);
	}
	else
	{
		cout<<k<<"*3+1="<<(3*k+1)<<endl;
		if(3*k+1==1)
			cout<<"End"<<endl;
		else
			calcu(3*k+1);
	}

}


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


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


int main()
{
    int n;
	int jiaogu(int n);
    cin>>n;
    if(n==1)
		cout<<"End"<<endl;
    else
    {
		jiaogu( n);
	}

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


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


int step(int n)
{if(n==1) printf("End\n");
else
{if(n%2==1)
printf("%d*3+1=%d\n",n,3*n+1);
else printf("%d/2=%d\n",n,n/2);
}
return 0;
}

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

int main()
{int n;
scanf("%d",&n);
jiaogu(n);
return 0;
}


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


int main(int argc, char* argv[])
{
	int n,a;
	scanf("%d",&n);
	if(n==1)
		printf("End");
	else{
		do
		{
			if(n%2==0)
			{
				a=n;
				n=a/2;
				printf("%d/2=%d\n",a,n);
			}
			else{
				a=n;
				n=a*3+1;
               	printf("%d*3+1=%d\n",a,n);

			}

		}
		while(n!=1);

		printf("End");
	}
	return 0;
}


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


int num(int n)
{
    if (n==1)
        return 1;
    else if (n%2==0)
    {
         printf("%d/2=%d\n",n,n/2);
         num(n/2);
    }
    else
    {
         printf("%d*3+1=%d\n",n,n*3+1);
         num(n*3+1);
    }
}
int main()
{
    int n;
    cin >> n;
    num(n);
    cout << "End";
    return 0;
}


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


int odd(int n)
{
	cout << n << "*3+1=" << n * 3 + 1 << endl;
	n = n * 3 + 1;
	return n;
}

int even(int n)
{
	cout << n << "/2=" << n / 2 << endl;
	n = n / 2;
	return n;
}

int main()
{
	int n;
	cin >> n;
	do{
		if (n == 1)
		{
			cout << "End" << endl;
			break;
		}
		if (n % 2 == 0)
			n = even(n);
		else
			n = odd(n);
	}while(1);
	return 0;
}


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

		}


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

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


int rec(int a)
{
	int b;
	if ((a%2) == 1)
	{
		b = a *3 + 1;
		cout << a << "*3+1=" << b << endl;
		return b;
	}
	else
	{
		b = a / 2;
		cout << a << "/2=" << b << endl;
		return b;
	}
}
int rec2(int(a))
{
	if (a > 1)
	{
		a = rec(a);
		rec2(a);
	}
	else
		cout << "End" << endl;
	return 0;
}
int main()
{
	int n ;
	cin >> n;
	rec2(n);
	return 0;
}


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


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


int guess(int x){
	if(x==1){
		cout<<"End";
		return 0;}
	else if(x%2==0){
		int b=x/2;
		cout<<x<<"/2="<<b<<endl;;
		return guess(b);
	}
	else {
		int b=x*3+1;
		cout<<x<<"*3+1="<<b<<endl;
		return guess(b);
	}
}
int main(){
	int n;
	cin>>n;
	if(!guess(n))
	return 0;
}


int function(int a)
{
	int b;
	if(a%2==1)
	{
		b=3*a+1;
		printf("%d*3+1=%d\n",a,b);
		return b;
	}
	else if(a%2==0)
	{
		b=a/2;
		printf("%d/2=%d\n",a,b);
		return b;
	}
}

void main()
{
	int n;
	scanf("%d",&n);
	if(n==1)
		printf("End\n");
	else
	{
		while(1)
		{
			n=function(n);
			if(n==1)
			{printf("End\n");break;}
		}
	}
}


int main()
{
    int operate(int n);
    int n;

    scanf("%d", &n);
    while(n != 1)
    n = operate(n);

    printf("End");

    return 0;

}

int operate(int n)
{
    int nn;
    if(n % 2 == 0)
    {
         nn = n / 2;
         printf("%d/2=%d\n", n, nn);
    }
    else
    {
         nn = 3 * n + 1;
         printf("%d*3+1=%d\n", n, nn);
    }
    return nn;
}


int ji(int x)
{
	cout<<x<<"*3+1="<<x*3+1<<endl;
	return (x*3+1);
}
 int ou(int x)
 {
	 cout<<x<<"/2="<<x/2<<endl;
	 return (x/2);
 }
 int main()
 {
	 int n;
	 cin>>n;
	 while(n!=1)
	 {
		 if(n%2==1) {n=ji(n);continue;}
		 else {n=ou(n);continue;}
	 }
		 if(n==1)cout<<"End"<<endl;
	 return 0;
 }


/*
 * qimo_3.cpp
 *
 *  Created on: 2010-12-17
 *      Author: 10265
 */
int main()
{
	int result;
	cin>>result;
	while(result!=1){
		if(result==1)break;
		if(result%2==0){
			if(result==1)break;
			cout<<result<<"/2="<<result/2<<endl;
			result=result/2;
		}
		if(result%2==1){
			if(result==1)break;
			cout<<result<<"*3+1="<<result*3+1<<endl;
			result=result*3+1;
		}
	}
	cout<<"End"<<endl;
	return 0;

}


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


void jishu(int n)
{int s;
s=n*3+1;
printf("%d*3+1=%d\n",n,s);
}
void oushu(int n)
{int s;
s=n/2;
printf("%d/2=%d\n",n,s);
}
int panduan(int n)
{if (n==1)return 5;
if (n%2==1)return 1;
if(n%2==0)return 0;
}

int main()
{int n,i;
	scanf("%d",&n);
if (n!=1)
 {for (i=1;n!=1;i++)
	{
	 if(panduan(n)==0){oushu(n);n=n/2;}
	 if(panduan(n)==1){jishu(n);n=n*3+1;}
		if(panduan(n==5))break;
	}

 }
 printf("End");

 }


void turn(int number);

int main()
{
	int n;
	cin >> n;
	turn(n);
        cout << "End";

	return 0;
}
void turn(int number)
{
	if(number != 1)
	{
		if(number % 2 == 0)
		{
			cout << number << "/2=" ;
			number = number / 2 ;
			cout << number << endl ;
		}
		else
		{
			cout << number << "*3+1=" ;
			number = number * 3 + 1 ;
			cout << number << endl ;
		}
		turn(number);
	}
	return ;
}


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

	if (n == 1)
	{
		cout << "End";
	}
	else if (n % 2 == 0)
	{
		cout << n << "/2=";
		n = n / 2;
		cout << n << endl;
		check(n);
	}
	else if ((n % 2 ==1) && (n != 1))
	{
		cout << n <<"*3+1=";
		n = n * 3 + 1;
		cout << n << endl;
		check(n);
	}
}


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


int main()
{
	int number=0;
	cin>>number;
	while(number!=1)
	{
		if(number%2==0)  {cout<<number<<"/2="<<number/2<<endl;number=number/2;}

		else

		{
		     cout<<number<<"*3+1="<<number*3+1<<endl;
			 number=number*3+1;
		}
	}
	cout<<"End"<<endl;
	cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();
	return 0;
}


void jiao(double x);
double ji(double x);
double ou(double x);
int main()
{
    double n;
    cin>>n;
    jiao(n);

    return 0;
     }
void jiao(double x)
{     if(x==1) {cout<<"End"<<endl;return;}
      if((int)x%2==1) {x=ji(x);jiao(x);return;}
      if((int)x%2==0) {x=ou(x);jiao(x);return;}
      }
double ji(double x)
{
      cout<<x<<"*"<<3<<"+"<<1<<"="<<3*x+1<<endl;
      return 3*x+1;
}
double ou(double x)
{
      cout<<x<<"/"<<2<<"="<<x/2<<endl;
      return x/2;
}


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


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


int main(int argc, char* argv[])
{
	int n;
	scanf("%d",&n);
	if (n==0)
		printf("End");
	else
	while (n!=1)
	{

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

}


int main()
{
	void f(int);
	int m;
	cin>>m;
	f(m);
	return 0;
}
void f(int m)
{
	if(m==1)
		cout<<"End";
	else if(m%2==0)
	{
		cout<<m<<"/2=";
		m=m/2;
		cout<<m<<endl;
		f(m);
	}
	else
	{
		cout<<m<<"*3+1=";
		m=3*m+1;
		cout<<m<<endl;
		f(m);
	}
}


int ji(int);
int ou(int);
int main()
{
	int	 n;
	cin >> n;
	while (n != 1)
	{
		if (n % 2 == 0)
		{
			n = ou(n);
		}
		else
		{
			n = ji(n);
		}

	}
	cout << "End" << endl;
return 0;
}
int	ou(int n)
{
	int k = n / 2;
	cout << n << "/2=" << k << endl;
	return k;
}
int	ji(int n)
{
	int k = n * 3 + 1;
	cout << n << "*3+1=" << k << endl;
	return k;
}


void jiao(int m);
int main()
{
	int m;
	cin >> m;
	jiao(m);
	return 0;
}
void jiao(int m)
{
	while( m != 1)
	{
		if(m % 2 == 0)
		{
			cout << m << "/2=";
			m = m / 2;
			cout << m << endl;
		}
		else
		{
			cout << m << "*3+1=";
			m = m * 3 + 1;
			cout << m << endl;
		}
	}
	if(m == 1)
		cout << "End" << endl;
}


void main()
{
	void put(int n);
	int n;
	scanf("%d",&n);

	put(n);
}

void put(int n)
{
	int t;
	if(n==1)
		printf("End");
	if(n%2==0)
	{
		t=n/2;
		printf("%d/2=%d\n",n,t);
		put(t);
	}
	if(n%2!=0&&n!=1)
	{
		t=n*3+1;
		printf("%d*3+1=%d\n",n,t);
		put(t);
	}
}


int gujiao(int x);
int main()
{
	int x;
	scanf("%d",&x);
	if(x==1)
	{
		printf("End");
	}
	else
	{
		while(x!=1)
		{
			x=gujiao(x);
			if(x==1)
			{
				printf("End");
				break;
			}

		}
	}
	return 0;
}
int gujiao(int x)
{
	int x0=x;
	if(x%2==1)
	{
		x=3*x0+1;
		printf("%d*3+1=%d\n",x0,x);
	}
	else
	{
		x=x0/2;
		printf("%d/2=%d\n",x0,x);
	}
	return x;
}


int proc(int i)
{
	int ans;
	if(i%2==1)
	{
		ans=i*3+1;
		printf("%d*3+1=",i);
	}
	else {
		ans=i/2;
		printf("%d/2=",i);
	}
	return ans;
}

int main () {
    int n;
	scanf("%d",&n);
	while (n>1) {
		n=proc(n);
		printf("%d\n",n);
	}
	printf("End");
    return 0;
}


int oddoreven(int a);
main()
{
      int a,b;
      scanf("%d",&a);
      for(a;;)
      {
           if(oddoreven(a)==1)
           {   b=a/2;
               if(b==1)
               {  printf("2/2=1\n");
                  printf("End");
                  break;
               }
               else
               {  printf("%d/2=%d\n",a,b);
                  a=b;
               }
           }
           else
           { if(a==1)
             {  printf("End");
                break;
             }
             else
             {  b=3*a+1;
                printf("%d*3+1=%d\n",a,b);
                a=b;
             }
           }

      }

}
int oddoreven(int a)
{
    if(a%2==0)
      return(1);
    else
      return(0);
}


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


int n;

void oddnum(int a)
{
	int b;
		b = a * 3 + 1;
		n = b;
	cout << a << '*' << 3 << '+' << 1 << '=' << b << endl;
}

void evennum(int a)
{
	int b;
	b = a / 2;
	n = b;
	cout << a << '/' << 2 << '=' << b <<endl;
}

int main()
{
	cin >> n;
	if (n == 1)
		cout << "End";
	else
	{
		while (n != 1)
		{
			if (n % 2 == 0)
				evennum(n);
			else
				oddnum(n);
		}
		cout << "End";
	}
	return 0;
}


//this program shows the proeess of jiaogu
int main()
{
	int n;
	scanf("%d",&n);
	for(;;)
	{
		if(n==1)
		{
			printf("End");
			break;
		}
		if(n%2==0)
		{
			n/=2;
			printf("%d/2=%d\n",2*n,n);
			continue;
		}
		if(n%2!=0)
		{
			printf("%d*3+1=%d\n",n,n*3+1);
			n=3*n+1;
			continue;
		}

	}
	return 0;
}


int jiaogu(int a)
{
	if(a==1){
		return 1;
	}
	if(a%2==1&&a!=1){
		cout<<a<<"*3+1="<<a*3+1<<endl;
		return a*3+1;
	}
	else if(a%2==0){
		cout<<a<<"/2="<<a/2<<endl;
		return a/2;
	}
}
int main()
{
	int a;
	cin>>a;
	while(a){
		a=jiaogu(a);
		if(a==1){
			cout<<"End"<<endl;
			break;
		}
	}
	return 0;
}


/*
 * qmfx03.cpp
 *
 *  Created on: 2011-1-1
 *      Author: Administrator
 */
int main()
{
	int n;
	cin>>n;
	while(true)
	{
		if(n==1)
		{
			cout<<"End"<<endl;
			break;
		}
		if(n!=1&&n%2==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)
		{
			cout<<"End"<<endl;
			break;
		}
	}
	return 0;
}


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


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


int fun1(int i)
{
//printf("fun1");
	int j;
	j=i*3+1;
	printf("%d*3+1=%d\n",i,j);
	return j;
}

int fun2(int i)
{
	//printf("fun2");
	int j;
	j=i/2;
	printf("%d/2=%d\n",i,j);
	return j;
}

int main()
{
	int i;
	scanf("%d",&i);
	do
	{
		if(i%2==1&&i!=1)
			i=fun1(i);
		else if(i%2==0)
			i=fun2(i);
	}
	while(i!=1);
	printf("End");

	return 0;
}


void ou(int n);
void ji(int n);
int main()
{
	int  n;
	cin >> n;
	if (n % 2 == 1)
		ji(n);
	else
		ou(n);
}
void ou(int n)
{
	int answer;
	answer = n / 2;
	cout << n << "/2=" << answer << endl;
	if (answer % 2 == 0)
		ou(answer);
	else
		ji(answer);
}
void ji(int n)
{
	if (n == 1){
		cout << "End"; return;
	}
	int answer;
	answer = n * 3 + 1;
	cout << n << "*3+1=" << answer << endl;
	if (answer % 2 == 0)
		ou(answer);
	else
		ji(answer);

}


int EVEN(int a);
int ODD(int b);
int main()
{
	int d=0;
	int n;
	scanf("%d",&n);
	for(int i=0;d!=5;i++)
	{
		if(n==1)
		{
			d=5;
			printf("End\n");
		}
		else
		{
			if(n%2==0)
				n=EVEN(n);
			else
				n=ODD(n);
		}
	}
}
int EVEN(int a)
{
	printf("%d/2=%d\n",a,a/2);
	a=a/2;
	return a;
}
int ODD(int b)
{
	printf("%d*3+1=%d\n",b,b*3+1);
	b=b*3+1;
	return b;
}


void main()
{
	int n,m;
	scanf("%d",&n);
	if(n==1)
		printf("End");
loop:while(n%2==0)
	{
		m=n/2;
		printf("%d/2=%d\n",n,m);
		n=m;
		if(n==1)
		{printf("End");break;}
	}
	 if(n!=1)
	 {
	     m=n*3+1;
		 printf("%d*3+1=%d\n",n,m);
		 n=m;
		 goto loop;
	printf("End");
	 }
}


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


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


int calculate(int x);
int main()
{
	int num;
	cin>>num;
	calculate(num);
	return 0;
}
int calculate(int x)
{
	if(x%2==0)
	{
		cout<<x<<"/2="<<x/2<<endl;
		x=x/2;
		if(x==1)
		{
			cout<<"End"<<endl;
		}
		else
		{
		    calculate(x);
		}
	}
	else if(x==1)
	{
		cout<<"End"<<endl;
	}
	else
	{
		cout<<x<<"*3+1="<<x*3+1<<endl;
		x=x*3+1;
		calculate(x);
	}

	return 0;
}


void Guess(int n)
{
    if (n == 1)
    {
        cout << "End" << endl;
    }
    else if (n % 2 != 0)
    {
        int result = n * 3 + 1;
        cout << n << "*3+1=" << result << endl;
        Guess(result);
    }
    else
    {
        int result = n / 2;
        cout << n << "/2=" << result << endl;
        Guess(result);
    }
}

int main()
{
    int n;
    cin >> n;
    Guess(n);
}


int main ()
{
    int n=0;
    cin >>n;
    while(n!=1)
    {
               if(n%2==0)
               {
                   cout<<n<<"/2=";
                   n=n/2;
                   cout<<n<<endl;;
                   }
               else
               {
                   cout<<n<<"*3+1=";
                   n=n*3+1;
                   cout<<n<<endl;
                   }
               }
    cout <<"End"<<endl;
    cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();cin.get();
    return 0;

}


void cal (int x)
{
	if (x == 1)
		cout << "End" << endl;
	if (x > 1)
	{
	if (x % 2 != 0)
	{
		cout << x <<"*3+1=";
		x = x * 3 + 1;
		cout << x << endl;
	}
	if (x % 2 == 0)
	{
		cout << x <<"/2=";
		x = x / 2;
		cout << x << endl;
	}
	cal ( x );
	}
	return;
}

int main()
{
	int x;
	cin >> x;
	cal (x );
	return 0;
}


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


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


int n;
int ji(int n)
{
	n = n * 3 + 1;
	cout << (n - 1) / 3 << "*3+1=" << n << endl;
	return n;
}

int ou(int n)
{
	n = n / 2;
	//cout << 'x' << n << endl;
	cout << n * 2 << "/2=" << n << endl;
	//cout << 'y' << n << endl;
	return n;
}

int main()
{
	cin >> n;
	while (n != 1)
	{
		if (n % 2 == 0)
			n = ou(n);
		if (n == 1)
			break;
		if (n % 2 == 1)
			n = ji(n);
	}
	cout << "End" << endl;
	return 0;
}


int isodd( int n)
{
        if (n % 2 == 0)
                return 1;
        else
                return 0;
}

int forodd(int n)
{
        printf("%d/2=%d\n", n, n/2);
        return n/2;
}

int fornot(int n)
{
        printf("%d*3+1=%d\n", n, n*3+1);
        return (n*3+1);
}

int main()
{
        int a = 0;
   //     char k,s; id[120] = {0}, rate[120] = {0};

        scanf("%d\n", &a);
        while (a != 1) {
                if (isodd(a))
                        a = forodd(a);
                else
                        a = fornot(a);
        }
        printf("End");
        return 0;
}


void a(int n)
{
	if(n==1)
	{
		cout<<"End"<<endl;
		return;
	}
	switch(n%2)
	{
	case 1:
		{
			cout<<n<<"*3+1="<<n*3+1<<endl;
			a(n*3+1);
			break;
		}
	case 0:
		{
			cout<<n<<"/2="<<n/2<<endl;
			a(n/2);
			break;
		}
	}
}
int main()
{
	int n;
	cin>>n;
	a(n);
}


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


void odd(int);
void even(int);
int n;
int main()
{
    scanf("%d",&n);
    even (n);

    return 0;
}
void odd(int n)
{
    if(n==1)
        printf("End");
    else
      {
          if(n%2==1)
        {
        printf("%d*3+1=%d\n",n,n*3+1);
        n=n*3+1;
        odd (n);
        }
        else even(n);
      }
}
void even(int n)
{
        if(n==1)
        printf("End");
    else
      {
          if(n%2==0)
        {
        printf("%d/2=%d\n",n,n/2);
        n=n/2;
        even (n);
        }
        else odd(n);
      }
}


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

int main ()
{
	int a, i;
	cin >> a;
	if ( a == 1 )
	{
		cout << "End" << endl;
	}
	else
	{
		for ( i = 0; ; i ++ )
		{
			if ( a == 1 )
			{
				cout << "End" << endl;
				break;
			}
			else
			{
				a = jiaogu(a);
				cout << a << endl;
			}
		}
	}
	return 0;
}


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


int jiaogu(int n)
{if(n==1) printf("End");
else
{if(n%2==1) {printf("%d*3+1=%d\n",n,3*n+1);jiaogu(3*n+1);}
else {printf("%d/2=%d\n",n,n/2);jiaogu(n/2);}
}
return 0;
}

int main()
{int n;
scanf("%d",&n);
jiaogu(n);
return 0;
}


int panduan(int a)
{
	if(a%2==1)
		return a*3+1;
	if(a%2==0)
		return a/2;
}
void shuchu(int b)
{
	if(b%2==1)
		cout<<b<<"*3+1="<<b*3+1<<endl;
	if(b%2==0)
		cout<<b<<"/2="<<b/2<<endl;
}
int main()
{
	int n;
	cin>>n;
	while(n!=1){
		shuchu(n);
		n=panduan(n);
	}
	cout<<"End"<<endl;
	return 0;
}


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

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


int main()
{
	void jiaogu(int n);
	int n,*a,k,j,i,max,t,s;
	scanf("%d",&n);
	jiaogu(n);
}
void jiaogu(int n)
{
	int i;
	if (n==1) printf("End");
	else if(n%2==0)  {i=n/2;printf("%d/2=%d\n",n,i);jiaogu(i);}
	else  {i=n*3+1;printf("%d*3+1=%d\n",n,i);jiaogu(i);}
}


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


int solve(int a);

int main()
{
	int x;
	cin >> x;
	solve(x);

return 0;
}

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


int temp(int x)//????

{
	if(x%2==1)
	{
	cout<<x<<"*3+1="<<x*3+1<<endl;
	return x*3+1;
	}
	else
	{
	cout<<x<<"/2="<<x/2<<endl;
	return x/2;
	}
}
int main()
{
	int n;
	cin>>n;
	while(n!=1)
	{
		n=temp(n);
	}
	cout<<"End"<<endl;
	getchar();
	getchar();
	return 0;
}


void main()
{
	int n,ans;
	scanf("%d",&n);
	if(n==1)printf("End");
	else
	{
		for(ans=n;ans!=1;)
		{
			if(ans%2)
			{
				printf("%d*3+1=%d\n\n",ans,ans*3+1);
				ans=ans*3+1;
			}
			else
			{
				printf("%d/2=%d\n\n",ans,ans/2);
				ans=ans/2;
			}
		}
		printf("End");
	}
}


/**
* @file homework.cpp
* @author ???
* @date 2011-11-13
* @description
* ??????: ????
*/
void buzhou(int);

int main()
{
	int n;
	cin>>n;
	buzhou(n);

	return 0;
}

void buzhou(int nf)
{
	while (nf!=1)
	{
	if (nf%2==1)
	{
		cout<<nf<<"*3+1="<<nf*3+1<<endl;
		nf=nf*3+1;
	}
	else
	{
		cout<<nf<<"/2="<<nf/2<<endl;
		nf=nf/2;
	}
	}
	cout<<"End";

}


int main()
{
	int odd(int x);int even(int y);//????
	int n;
	cin>>n;
	while(n!=1)
	{if(n%2==0)
	   {n=even(n);}//??????
	else
	   {n=odd(n);}//??????
	}
	cout<<"End";
	return 0;

}

int odd(int x)//????
{ int y;
  y=3*x+1;
  cout<<x<<"*3+1="<<y<<endl;
  return y;
}

int even(int x)//????
{ int y;
  y=x/2;
  cout<<x<<"/2="<<y<<endl;
  return y;
}


int even(int a)
{
	int b;
	b=a/2;
	return(b);
}

int odd(int a)
{
	int b;
	b=a*3+1;
	return(b);
}

void main()
{
	int n,m;
	scanf("%d",&n);
	if(n==1)
	{
		printf("End");
		return;
	}
	while(1)
	{
		if(n%2==0)
		{
			m=even(n);
			printf("%d/2=%d\n",n,m);
			n=m;
			if(m==1)
			{
				printf("End");
				break;
			}
		}
		else
		{
			m=odd(n);
			printf("%d*3+1=%d\n",n,m);
			n=m;
			continue;
			if(m==1)
			{
				printf("End");
				break;
			}
		}
	}
}


void jiaogu(int);
int main()
{
    int n;
    cin >> n;
    jiaogu(n);
    return 0;
}
void jiaogu(int a)
{
     int i, j;
     while(a != 1)
     {
             if(a % 2 ==0)
             {
                  i = a / 2;
                  cout << a << "/2=" << i << endl;
                  a = a / 2;
             }
             else
             {
                 j = a * 3 + 1;
                 cout << a << "*3+1=" << j <<endl;
                 a = a * 3 + 1;
             }
     }
     cout << "End" << endl;
}


int calculate(int a){
    if(a==1)
    return 0;
    else if(a%2==1)
    return 3*a+1;
    else
    return a/2;
}

int main(){
    int n,m=0;
    cin>>n;
    while(n!=1)
    {
        m=calculate(n);
        if(n%2==1)
            cout<<n<<"*3+1="<<m<<endl;
        else
            cout<<n<<"/2="<<m<<endl;
        n=m;
    }
    cout<<"End"<<endl;
    return 0;
}


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


int pan(int);
int main()
{
	int a;
	cin >> a;
	while(a != 1)
	{
		a = pan(a);
	}
	cout << "End";
	return 0;
}
int pan(int a)
{
	int b;
	if(a % 2 == 0)
	{
		b = a / 2;
		cout << a << "/2=" << b << endl;
	}
	else
	{
		b = a * 3 + 1;
		cout << a << "*3+1=" << b << endl;
	}
	return b;
}


int main()
{
int n,sum,i,t;

scanf("%d",&n);

sum=n;

for(i=0;sum!=1;i++)
{
	if(sum%2!=0){t=sum;sum=sum*3+1;printf("%d*3+1=%d\n",t,sum);}

	else if(sum%2==0){t=sum;sum=sum/2;printf("%d/2=%d\n",t,sum);}
}

printf("End");
return 0;
}


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


int trail[100000];

int counter;
int functio(int n){
    if(n%2==0){
       counter=counter+1;
       trail[counter]=n;
       return functio(n/2);

    }
    if(n%2==1 && n>2){
       counter=counter+1;
       trail[counter]=n;
       return functio(3*n+1);
    }
    if(n==1){
       counter=counter+1;
       trail[counter]=1;
       return 0;
    }

}
int main(){
    int n;
    cin>>n;
    functio(n);
    for(int i=1;i<=counter;i++){
        if (trail[i]%2==0) cout<<trail[i]<<'/'<<2<<'='<<trail[i]/2<<endl;
        else if (trail[i]>2 && trail[i]%2==1 ) cout<<trail[i]<<"*3+1="<<trail[i]*3+1<<endl;
        else cout<<"End"<<endl;
    }

}


int f1(int a)
{
	int b;
	b = a / 2;
	cout << a << "/2=" << b << endl;
	a = b;
	return a;
}

int f2(int a)
{
	int b;
	b = a * 3 + 1;
	cout << a << "*3+1=" << b << endl;
	a = b;
	return a;
}

int main()
{
	int a;
	cin >> a;
	while (a != 1)
	{
		if ((a%2) == 0)
		{
			a = f1(a);
		}
		else
		{
			a = f2(a);
		}
	}
	cout << "End" << endl;
	cin.get();
	cin.get();
	return 0;
}


int main()
{
	int n,k,sum=0;
	cin>>n;
	while(n!=1)
	{
		cout<<n;
		if(n%2)
		{
			cout<<"*3+1=";
			n=n*3+1;
		}
		else
		{
			cout<<"/2=";
			n=n/2;
		}
		cout<<n<<endl;

	}
	cout<<"End";
	return 0;
}


void main()
{
void operate(int x);
int n;
scanf("%d",&n);
operate(n);
}

void operate(int x)
{
int y;
if(x==1){printf("End");return;}
else if(x%2==1){y=x;x=x*3+1;printf("%d*3+1=%d\n",y,x);}
else if(x%2==0){y=x;x=x/2;printf("%d/2=%d\n",y,x);}
operate(x);
}


int main()
{
    int guocheng(int n);
    int n;
    cin>>n;
    if(n==1) cout<<"End"<<endl;
    else
    {
        guocheng( n);
        cout<<"End"<<endl;
     }
    return 0;
}
 int guocheng(int n)
{
    int n1=0;
    while(n!=1)
    {
        if(n%2==0)
        {
            n1=n/2;
            cout<<n<<"/2="<<n1<<endl;
            n=n1;
        }
        else
        {
            n1=3*n+1;
            cout<<n<<"*3+1="<<n1<<endl;
            n=n1;
        }
    }
}


void process(int n)
{
	int m;
	if (n == 1)
	{
		cout <<"End" << endl;
		return;
	}
	if (n % 2 == 0)
	{
		m = n / 2;
		cout << n << '/' << 2 << '=' << m << endl;
	}
	else
	{
		m = n * 3 + 1;
		cout << n << "*3+1=" << m << endl;
	}
	process(m);
}
int main()
{
	int n;
	cin >> n;
	process(n);
	return 0;
}


int odd (int a);
int even (int a);
int main ()
{
	int n;
	cin>>n;
	while (n!=1) //???1???????
	{
		if (n%2==0)
			n=even (n);
		else
			n=odd (n);
	}
	cout<<"End";

	return 0;
}
int odd (int a)	//?????????
{
	cout<<a<<"*3+1=";
	a=a*3+1;
	cout<<a<<endl;
	return a;
}
int even (int a)	//?????????
{
	cout<<a<<"/2=";
	a=a/2;
	cout<<a<<endl;
	return a;
}


void dol(int a);
void sgl(int a)
{
	if(a==1)cout<<"End"<<endl;
	else
	{
		cout<<a<<"*3+1="<<a*3+1<<endl;
		dol(a*3+1);
	}
}
void dol(int a)
{
	cout<<a<<"/2="<<a/2<<endl;
	if((a/2)%2==0)dol(a/2);
	else sgl(a/2);
}
int main()
{
	int a;
	cin>>a;
	if(a%2==1)sgl(a);
	else dol(a);
	return 0;
}


int main()
{
  int n,i;
  cin>>n;
  while(n!=1)
  {
  if(n%2==0)
   {
   cout<<n<<"/2=";
   n=n/2;
   cout<<n<<endl;
   }
   else
  	 {

   cout<<n<<"*3+1=";
   n=n*3+1;
   cout<<n<<endl;
	  }
  }
    cout<<"End"<<endl;
   cin.get(); cin.get(); cin.get();
   return 0;
   }


/*
 * 206.cpp
 *
 *  Created on: 2011-12-4
 *      Author: think
 */
void print(int n){
	if(n%2==0){
		cout<<n<<"/2="<<n/2<<endl;
	}
	else{
		cout<<n<<"*3+1="<<n*3+1<<endl;
	}
}
int cal(int n){
	if(n==1){
		cout<<"End"<<endl;return 0;
	}
	print(n);
	if(n%2==0)return cal(n/2);
	else return cal(n*3+1);
}
int main(){
	int n;
	cin>>n;
	cal(n);
	return 0;
}


void main()
{
	int bb(int n);
    int n;
    scanf("%d",&n);
    bb(n);
}
int bb(int n)
{
	int m;
	if(n==1)
    printf("End");
    else
    {
    	if(n%2==0)
    	{
    		printf("%d/2=%d\n",n,m=n/2);
    	}
    	else
    	{
    		printf("%d*3+1=%d\n",n,m=n*3+1);
    	}
    	bb(m);
    }
}


int main ()
{
	int a,b,c,i;
	scanf("%d",&a);
	for (i=1;a!=1;i++)
	{
		if (a%2==0)
		{   b=a/2;
            printf("%d/2=%d\n",a,b);
			a=b;
			continue;
		}
		else if (a!=1)
			{
			c=a*3+1;
			 printf("%d*3+1=%d\n",a,c);
			 a=c;
		}
		else
			break;
	}
	printf("End\n");
	return 0;
}


int hang(int i,int row,int col,int sz[8][8])   //?????????????
{
int j,max;
max=sz[i][0];
for(j=1;j<col;j++)
{
if(sz[i][j]>max)
max=sz[i][j];
}
return max;
}
int lie(int j,int row,int col,int sz[8][8])     //?????????????
{
int i,min;
min=sz[0][j];
for(i=1;i<row;i++)
	{
	if(sz[i][j]<min)
		min=sz[i][j];
	}
return min;
}
void main()
{
int row,col,i,j,sz[8][8],flag=0,m,n;
scanf("%d,%d",&row,&col);
	for(i=0;i<row;i++)
	{
		for(j=0;j<col;j++)
		{
			scanf("%d",&sz[i][j]);
		}
	}
	for(i=0;i<row;i++)
	{
		for(j=0;j<col;j++)
		{
			m=hang(i,row,col,sz);
			n=lie(j,row,col,sz);
			if(m==n)     //??????????????
			{
				printf("%d+%d\n",i,j);
				flag++;
				break;
			}
		}
		if(flag==1)
		{
			break;
		}
	}
	/*	for(i=0;i<row;i++)
		{
		for(j=0;j<col;j++)
		{
			printf("%d",sz[i][j]);
		}
		}*/

	if(flag==0)
	printf("No\n");
	}


int a[10][10];
int main()
{
int row,col,ROW,COL;
int sum=0;
int sum1=0;
scanf("%d,%d",&ROW,&COL);
for(row=0;row<ROW;row++)
for(col=0;col<COL;col++)
scanf("%d",&a[row][col]);
for(row=0;row<ROW;row++)
for(col=0;col<COL;col++)
{
for(int colcol=0;colcol<COL;colcol++)
{
if(a[row][col]<a[row][colcol])
sum=1;
}
for(int rowrow=0;rowrow<ROW;rowrow++)
{
if(a[row][col]>a[rowrow][col])
sum=1;
}
if(sum==0)
{
printf("%d+%d",row,col);
sum1=1;
}
sum=0;
}
if(sum1==0)
printf("No");
return 0;
}


int main()
{
       int a[7][7];
       int i,j,b,row,col,count1;
       int m,n;
       scanf("%d",&n);
       scanf(",");
       scanf("%d",&m);
       for(i=0;i<n;i++)
       {
               for(j=0;j<m;j++)
               {
                       scanf("%d",&(a[i][j]));
               }
       }
       for(i=0;i<n;i++)
       {
		   col=0;
		   count1=1;
               b=a[i][0];
               for(j=0;j<m;j++)
               {
                       if(a[i][j]>b)
                       {
                               b=a[i][j];
                               col=j;
                               count1=1;
                       }
               }

               for(j=0;j<n;j++)
               {
                       if(b>a[j][col])
                       {
                       count1=0;

                      continue;
                       }
               }
               if(count1==1){
printf("%d+%d",i,col);
break;}
       }
       if(count1==0)printf("No");
       return 0;
}


int main(int argc, char* argv[])
{
	int sz[8][8];
	int ROW,COL,i,j;
	scanf("%d,%d",&ROW,&COL);
	for(i=0;i<ROW;i++)
	{
		for(j=0;j<COL;j++)
		{
			scanf("%d",&sz[i][j]);
		}
	}
	int p,q;
	int t;
	t=0;

	for(i=0;i<ROW;i++)
	{
		p=0;
	    q=0;
		for(j=0;j<COL;j++)
		{
			if(sz[i][j]>sz[i][q])
			{
				p=i;
				q=j;
			}
		}
		for(i=0;i<ROW;i++)
		{
			if(sz[p][q]>sz[i][q])
			{
				t=1;
			}
		}
		if(t==0)
			break;

	}
	if(t==1)
	{
		printf("No");
	}
	else if(t==0)
	{
		printf("%d+%d",p,q);
	}

	return 0;
}


void main()
{
	int i,j,k,a[8][8],b[8],max,row,col,result=1;
	scanf("%d,%d",&row,&col);
	for(i=0;i<row;i++)
	{
		max=0;
		for(j=0;j<col;j++)
		{
			scanf("%d",&a[i][j]);
			if(a[i][j]>a[i][max]) max=j;
		}
		b[i]=max;
	}
	for(i=0;i<row;i++)
	{
		for(k=0;k<row;k++)
		{
			if(a[k][b[i]]<a[i][b[i]]) result=0;
		}
		if(result)
		{
			printf("%d+%d",i,b[i]);
			break;
		}
		else
		{
			printf("No");
			break;
		}
	}
}


int main()
{
	int row,col,rownum,colnum,i=20,j=20;
	int rowmax[SIZE],colmin[SIZE],num[SIZE][SIZE];
	scanf("%d,%d",&rownum,&colnum);
	for(row=0;row<rownum;row++)
	{
		for(col=0;col<colnum;col++)
		{
			scanf("%d",&num[row][col]);
		}
	}
	for(row=0;row<rownum;row++)
	{
		rowmax[row]=num[row][0];
		for(col=0;col<colnum;col++)
		{
			if(rowmax[row]<num[row][col])
				rowmax[row]=num[row][col];
			else
				continue;
		}
	}
	for(col=0;col<colnum;col++)
	{
		colmin[col]=num[0][col];
		for(row=0;row<rownum;row++)
		{
			if(colmin[col]>num[row][col])
				colmin[col]=num[row][col];
			else
				continue;
		}
	}
	for(row=0;row<rownum;row++)
	{
		for(col=0;col<colnum;col++)
		{
			if(rowmax[row]==colmin[col])
			{
				i=row;
				j=col;
				break;
			}
			else
				continue;
		}
	}
	if(i==20&&j==20)
		printf("No");
	else
		printf("%d+%d",i,j);
	return 0;
}


int main()
{
    int maxn = 8;
    int n,m,a[maxn][maxn];
    int i,j,k,flag,flagg,tmp;

    scanf("%d,%d",&n,&m);
    flagg=0;
    for (i=0;i<n;i++)
    {
        for (j=0;j<m;j++)
        {
            scanf("%d",&a[i][j]);
        }
    }
    for (i=0;i<n;i++)
    {
        tmp=0;
        flag=0;
        for (j=0;j<m;j++)
        {
            if (tmp<a[i][j]) {tmp=a[i][j];k=j;}
        }
        for (j=0;j<n;j++)
        {
            if (tmp>a[j][k])
            {
                flag=1;
            }
        }
        if (flag==0) {printf("%d+%d",i,k);flagg=1;break;}
    }
    if (flagg==0) {printf("No");}
    return 0;
}


int main()
{
	int row,col,sz[8][8];
	char q;
	cin>>row>>q>>col;
	int i,j;
	for(i=0;i<row;i++)
	{
		for(j=0;j<col;j++)
		{
			cin>>sz[i][j];
		}
	}
	int count=0;
	for(i=0;i<row;i++)
	{
		int a=0;
		for(j=1;j<col;j++)
		{
			if(sz[i][a]<sz[i][j])
			{
				a=j;
			}
		}
		int m=0,k=0;
		for(m=0;m<row;m++)
		{
			if(sz[i][a]>sz[m][a])
			{
				count++;
				break;
			}
			else
				k++;
		}
		if(k==row)
			cout<<i<<'+'<<a;
	}
	if(count==row)
		cout<<"No";
	return 0;
}


int main(){
	int sz[8][8];
	int i,k,row;
	char a;
	int ROW,COL,m=0,n=0,j=0;
	scanf("%d%c%d",&ROW,&a,&COL);
	for(i=0;i<ROW;i++){
		for(k=0;k<COL;k++){
			scanf("%d",&sz[i][k]);
		}
	}
	for(row=0;row<ROW;row++){
		for(k=0;k<COL;k++){

			if(sz[row][m]<sz[row][k]){
               m=k;
			}
		}
			for(i=0;i<ROW;i++){
				if(sz[n][m]>sz[i][m]){
					n=i;
				}
			}
				if(row==n){
					printf("%d+%d",row,m);
					j++;
				}
				}
	if(j==0){
		printf("No\n");
	}
	return 0;
}