semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
/*
Name:???
ID:1200012842
Email:443972553@qq.com
*/
int main()
{
    int n;
    cin>>n;
    while (n>1)
    {
          if (n%2)
          {
             printf("%d*3+1=%d\n",n,n*3+1);
             n=n*3+1;
             }
          else
          {
              printf("%d/2=%d\n",n,n/2);
              n=n/2;
              }
          }
    cout<<"End";
    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;
}
//???2010?12?1?

//??: 1000010586_???

//??; ????

int make( int n );
int main()
{
	int n;
	cin >> n;
	make ( n );
	return 0;
}
int make( int n )
{
	if ( n == 1 )
	{
		cout << "End" << endl;
		return 0;
	}
	else
	{
		if ( 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;
		}
		return make( n );
	}
}
int n,m;
void jisuan()
{

 while(n!=1)
    {
        if(n%2!=0)
        {
            m=n*3+1;
            cout<<n<<"*3+1="<<m<<endl;
            n=m;
        }
        if(n%2==0)
        {
            m=n/2;
            cout<<n<<"/2="<<m<<endl;            //??????
            n=m;
        }
    }
}
int main()
{

    cin>>n;              //??n
    if(n==1)             //??n???1
    cout<<"End";
    if(n!=1)             //n??1?
    {
    jisuan();
    cout<<"End";                            //n=1???
    }
    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()
{
    long x,m; 
    scanf("%ld",&x);
    while (x!=1)
    {
      if (x%2==0)  {printf("%ld/2=%ld\n",x,x/2);x=x/2;}
       else {m=x*3+1;printf("%ld*3+1=%ld\n",x,m);x=m;}
      
          }
    if (x==1)printf("End");

    }
int main()
{
	int n;
	scanf("%d",&n);
	if(n==1)
		printf("End");
	else{
		while(n!=1)
		{
			if(n%2!=0)
			{
				printf("%d",n);
				n=n*3+1;
				printf("*3+1=%d\n",n);
			}
			if(n%2==0)
			{
				printf("%d",n);
				n=n/2;
				printf("/2=%d\n",n);
			}
		}
		if(n==1)
		{
			printf("End");
		}
	}
				
	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 f(int n){
	while(n!=1){
		if((n%2)==1){cout<<n<<"*3+1="<<(3*n+1)<<endl;
		n=n*3+1;}
		else {cout<<n<<"/2="<<n/2<<endl;
		n=n/2;
		}
	}
	cout<<"End"<<endl;
}
int main(){
 int m;
 cin>>m;
 f(m);
 return 0;
}
int main()
{
    int n=0,a=0,b=10;
    scanf("%d",&n);
    while(n>1)
    {
                    if(n-(n/2)*2==0)
                    {
                                  b=n/2;
                                  printf("%d/2=%d\n",n,b);
                                  n=b;
                    }
                    else
                    {
                                  b=n*3+1;
                                  printf("%d*3+1=%d\n",n,b);
                                  n=b;
                    }
    }
    printf("End");
}
int main()
{
	int n,i;
	scanf("%d",&n);
	for(i=1;n!=1;i++)
	{
		if(n%2==1)
		{
			printf("%d",n);
			n=3*n+1;
			printf("*3+1=%d\n",n);
		}
		else
		{
			printf("%d",n);
			n=n/2;
			printf("/2=%d\n",n);
		}
	}
	printf("End");
	return 0;
}
int main()
{
    int n,s,t,i=2;
	scanf("%d",&n);
	s=n;
	if(n==1)
		printf("End");
	else {
	while(i!=1){
		if(s%2==0){
			t=s/2;
			printf("%d/2=%d\n",s,t);
            s=t;
		}
        else{
            t=s*3+1;
			printf("%d*3+1=%d\n",s,t);
			s=t;
		}
		i=s;
	}
	printf("End\n");
	}
	return 0;
}
int jiaogu(int a)                             //????jiaogu
{
	if(a%2==0&&a!=0)                          //??a?????????2???????
	{cout<<a<<"/"<<"2"<<"="<<a/2<<endl;
	 return jiaogu(a/2);}
	else if(a%2==1&&a!=1)                     //??a?????????3??????????
	{cout<<a<<"*"<<"3"<<"+"<<"1"<<"="<<(a*3)+1<<endl;
	return jiaogu(a*3+1);}
	else if(a==1)                             //???1?????
	{cout<<"End"<<endl;
	 return 0;}

}
int main()                                   //?????
{
	int a;
	cin>>a;                                  //??a
	jiaogu(a);                               //????
	return 0;  
}                                            //?????
/*

?? 
???????????????????????????3?1??????????2?????????????????????????1??????????5????????16?8?4?2?1? 
??????????????????1????????
 
???? 
????
 
???? 
??????1???????????????????????????7?????? 
7*3+1=22 
22/2=11 
11*3+1=34 
34/2=17 
17*3+1=52 
52/2=26 
26/2=13 
13*3+1=40 
40/2=20 
20/2=10 
10/2=5 
5*3+1=16 
16/2=8 
8/2=4 
4/2=2 
2/2=1 
??????"End"??????1?????"End" 

 
???? 
5
 
???? 
5*3+1=16
16/2=8
8/2=4
4/2=2
2/2=1
End
 
 
*/



void process(int af)
{
	int bf;
	if (af%2==0)
	{
		bf=af/2;
		cout<<af<<"/2="<<bf<<endl;
		process(bf);
	}
	else if ((af%2==1)&&(af!=1))
	{
		bf=af*3+1;
		cout<<af<<"*3+1="<<bf<<endl;
		process(bf);
	}
	else if (af==1)  cout<<"End"<<endl;
}


int main()
{
	int n;
	cin>>n;
	process(n);
    return 0;
}
void main()
{
	int n,i,j,k,r;
	scanf("%d",&n);
	while(n!=1)
	{
		r=n%2;
		if(r==0)
		{
			
			printf("%d/2=%d\n",n,n/2);
			n=n/2;
		}
		if(r!=0)
		{
			printf("%d*3+1=%d\n",n,n*3+1);
			n=n*3+1;
		}
	}
	printf("End");
}
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);
	}

}
//**************************************
//*???????                     
//*????? 1100012780     	        
//*???2011.11.03                     
//**************************************

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

int main()
{
	int n;
	cin>>n;
	kakutani(n);
	return 0;
}
int main(){
	int n,i,j,a[10000],b=0,c,d=0;
	
	scanf("%d",&n);
	if(n==1) printf("End");
	else{
		for(i=0;;i++){
			if(n==1){
				printf("End");
				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 slove(int n)
{
	if (n != 1)
	{
	if (n % 2 != 0)
	{
		cout << n << "*3+1=" << n * 3 + 1 << endl;
		slove(n * 3 + 1);
	}
	if (n % 2 == 0)
	{
		cout << n << "/2=" << n / 2 << endl;
		slove(n / 2);
	}
	}
}
int main()
{
	int n;
	cin >> n;
	slove(n);
	cout << "End" << endl;
	return 0;
}
int main()
{
	int a=0;//??????;
	cin>>a;
	int yushu=0;
	yushu=a%2;
	for(;a!=1;)
	{
	if(yushu==0)
	{
		cout<<a<<"/2="<<(a*0.5)<<endl;
		a=a/2;
		yushu=a%2;
	}
	else 
	{
		cout<<a<<"*3+1="<<(a*3+1)<<endl;
		a=a*3+1;
		yushu=a%2;
	}
	}
	cout<<"End"<<endl;
	return 0;
}
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 n;
  cin >> n;
  int a;
  while(n>1)
  {
    if(n%2==1)
    {
     a=n*3+1;
     cout << n << "*" << 3 << "+" << 1 << "=" << a << endl;
     n=a;
    }
    else
    {
      a=n/2;
      cout << n << "/" << 2 << "=" << a << endl;
      n=a;
    }
   }
   cout << "End" << endl;
   cin.get();cin.get();cin.get();
   return 0;
}
int main()
{
	int a,A;
	scanf("%d",&a);
	if(a==1)
	{
		printf("End");
	}
	else
	{
		while(A!=1)
		{
			if(a%2==0)
			{
				A=a/2;
				printf("%d/2=%d\n",a,A);
			}
			if(a%2!=0)
			{
				A=a*3+1;
				printf("%d*3+1=%d\n",a,A);
			}
			a=A;
		}
		printf("End");
	}
	return 0;
}
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 main()
{
	int n;
	scanf("%d",&n);
	if(n==1)
	{
		printf("End\n");
		return 0;
	}
	int a=n;
	for(;a!=1;)
	{
		if(a%2!=0)
		{
			a=n*3+1;
			printf("%d*3+1=%d\n",n,a);
			n=a;
		}
		else
		{
			a=n/2;
			printf("%d/2=%d\n",n,a);
			n=a;
		}
	}
	printf("End\n");
	return 0;
}
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;
}
void main()
{
	int n,t,k;
	scanf("%d",&n);
	if(n!=1) for(k=1;t!=1;k++)
	{if(n%2==0){t=n/2;printf("%d/2=%d\n",n,t);n=t;if(n==1)break;}
	if(n%2!=0){t=n*3+1;printf("%d*3+1=%d\n",n,t);n=t;if(n==1)break;}}
	printf("End");
	
}
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 n,m;
	scanf("%d",&n);
         if(!(n==1)){
	  do{
		if(n%2==0){
			m=n/2;
			printf("%d/2=%d\n",n,m);
		}else{
			m=n*3+1;
			printf("%d*3+1=%d\n",n,m);
		}
		n=m;
	  }
	  while(!(n==1));
         }
	printf("End");
	return 0;
}
int fun(int m);                                       //??????
int a;                                                //??????
int main()
{
	int n;
	cin>>n;
	a = n; 
	if(n == 1)
		cout<<"End"<<endl;                 //?????1,???End
	else
	{
		while(fun(a) != 1)                //?????1,?????fun()??,???1??
			fun(a);
		cout<<"End"<<endl;
	}
	return 0;
}
int fun(int m)                                      //?????
{
	if(m % 2 != 0)
	{
		a = m * 3  + 1;
		cout<<m<<"*3+1="<<a<<endl;
		return a;
	}
	else
	{
		a = m / 2;
		cout<<m<<"/2="<<a<<endl;
		return a;
	}
}
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;
}
int main(){
int n;
int a,e;
a=0;
scanf("%d",&n);
if(n==1){
	printf("End");
}
else if(n!=1){
	a=n;
	for(;a!=1;){
		if(a%2==0){
			e=a;
			a=a/2;
			printf("%d/2=%d\n",e,a);
			if(a==1){
				printf("End");
				break;
			}
		}
		else if(a%2==1){
			e=a;
			a=a*3+1;
			printf("%d*3+1=%d\n",e,a);
			if(a==1){
				printf("End");
			break;
			}
		}
	}
}
return 0;
}
void main()
{
	int n,t;
	scanf("%d\n",&n);
	t=n;
	if(n==1)
	printf("End");
	if(n!=1)
	{	do
	{
	        if(t%2!=0&&t!=1)
			{
			printf("%d*3+1=%d\n",t,t*3+1);
	        t=t*3+1;
			}
	        if(t%2==0&&t!=1)
			{
	 	     printf("%d/2=%d\n",t,t/2);
	         t=t/2;
			}
	}while(t!=1);	
	printf("End");}
	
}
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;
}
/**************
*????
*?????
***************/
void f1(int); //????
void f2(int); //????
int main()
{
	int n;
	cin>>n;
	if(n == 1)     //?1?????
	{
		cout<<"End";
	}
	else
	{
		if(n%2 == 0) //????f2
		{
			f2(n);
		}
		else         //????f1
		{
			if(n%2 == 1)
			{
				f1(n);
			}
		}
	}
return 0;
}
void f1(int a)                       //????
{
	int b;
	b=3*a+1;          //??????
	cout<<a<<"*"<<3<<"+"<<1<<"="<<b<<endl;//???????
	if(b == 1)         //????
	{
		 cout<<"End";
	}
	else            //????
	{
		if(b%2 == 0)
		{
			f2(b);
		}
		else
		{
			if(b%2 == 1)
			{
				f1(b);
			}
		}
	}
}
void f2(int a)//??
{
	int b;
	b=a/2;
	cout<<a<<"/"<<2<<"="<<b<<endl;   
	if(b == 1)
	{
		cout<<"End";
	}
	else
	{
		if(b%2 == 1)
		{
			f1(b);
		}
		else
		{
			if(b%2 == 0)
			{
				f2(b);
			}
		}
	}
}
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 argc, char* argv[])
{int m;
scanf("%d",&m);
if (m==1)
printf("End");
else
{
    while(m!=1)
	{  if((m-2*(m/2))!=0)
	{printf("%d*3+1=%d\n",m,m*3+1);
     m=m*3+1;
	}
       if((m-2*(m/2))==0)
	   {
        printf("%d/2=%d\n",m,m/2);
          m=m/2;
	   }
	}
	printf("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 main()
{
	int	a,b,c,d;
	scanf("%d",&a);
	b=a%2;
	c=3*a+1;
	d=a/2;
	if (a==1)
	{printf("End");
	} 
	else
	{  for (;a != 1;){
		 for (;b == 0 && a != 1 ; )
	     {
		 d=a/2;
		 printf("%d/2=%d\n",a,d);
		 a=d;
		 b=a%2;
	     }
         for (;b == 1  && a != 1 ; )
	     {
		 c=3*a+1;
		 printf("%d*3+1=%d\n",a,c);
		 a=c;
		 b=a%2;
	     }
	  }
	 printf("End");
	}
	return 0;
}
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;
}
void f(int n);              //????; 
int main()                  //???;
{
	int n;
	cin >> n;
	f(n);
	return 0;
}
void f(int n)
{
	if(n==1)               //?????1?????"End";
		cout << "End" << endl;
	else
	{
		if(n%2==1)             //????????3?1;
		{
			cout << n << "*" << 3 <<"+" << 1 << "=" <<3*n+1 << endl;
			n=3*n+1;
			f(n);
		}
		else if(n%2==0)       //?????????2?????????????????; 
		{
			cout << n << "/" << 2 << "="<< n/2 << endl;
			n=n/2;
			f(n);
		}
	}
	return;
}
void f(int n)
{
    if(n==1) printf("End\n");
    else
    {
        if(n%2==0)
        {
            printf("%d/2=%d\n",n,n/2);
            n=n/2;
            f(n);
        }
        else
        {
            printf("%d*3+1=%d\n",n,n*3+1);
            n=n*3+1;
            f(n);
        }
    }
}
int main()
{
    int n;
    scanf("%d",&n);
    f(n);
}
void jg(int);
int main()
{
	int n;
	scanf("%d",&n);
	jg(n);
}

void jg(int n)
{
	if (n==1) printf("End");
	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;
		}
		jg(n);
	}
}
void main(void)
{
	int a, k;
	scanf("%d", &a);
	while(a != 1)
		if(a % 2 == 1)
		{
			k = a;
			a = a * 3 + 1;
			printf("%d*3+1=%d\n",k,a);	
		}
		else
		{
			k = a;
			a = a / 2;
			printf("%d/2=%d\n",k ,a);
		}
	if(a == 1)
		printf("End\n");
			
}
//****************************
//* ??:????            *
//* ?????               *
//* ???12?10?           *
//****************************
void f(int n)
{
	if(n==1)//??n????
		cout<<"End";
	else if(n%2==0)
	{
		cout<<n<<"/2="<<n/2<<endl;
		n=n/2;
		f(n);//???????
	}
	else
	{
		cout<<n<<"*3+1="<<(n*3+1)<<endl;
		n=n*3+1;
		f(n);
	}
}
int main()
{
	int a=0;
	cin>>a;
	f(a);
	return 0;
}
int main()
{
 int n;
 scanf("%d", &n);
 if(n!=1){
	 while(n != 1)
{
 if(n%2==1)
 {   printf("%d*3+1=%d\n", n,n*3+1);
     n=n*3+1; 
 }
 else 
  {printf("%d/2=%d\n",n,n/2 );

   n = n/2; 
 }
  }

	 printf("End\n"); }
 else if (n=1){printf("End\n");}

 return 0; 

}
void main()
{
   int i;
   char str[5]={'E','n','d'};
   scanf("%d",&i);
   while(i!=1)
   {
	   if(i%2==0)
	   {
		   printf("%d/2=%d\n",i,i/2);
		   i=i/2;
	   }
	   else
	   {
		   printf("%d*3+1=%d\n",i,i*3+1);
		   i=i*3+1;
	   }
   }
   printf("%s",str);
}
main()
{
	int m,n,r;
	scanf("%d",&m);
	if(m!=1)
	{
	do
	{
		r=m%2;
		n=m;
		if(r!=0)
		{
			m=m*3+1;
			printf("%d*3+1=%d\n",n,m);
		}
		if(r==0)
		{
			m=m/2;
			printf("%d/2=%d\n",n,m);
		}
	}while(m!=1);
	}
	printf("End");
}
void jg(int n)
{
	int m;
	if(n!=1)
	{
		if(n%2==1)
		{
			m=3*n+1;
		cout<<n<<"*"<<3<<"+1="<<m<<endl;
		n=m;
		jg(n);
		}
		else
		{
			m=n/2;
			cout<<n<<"/2="<<m<<endl;
			n=m;
			jg(n);
		}
	}
	else
		cout<<"End"<<endl;
}

 
int main()
{
	int n;
	cin>>n;
	jg(n);
	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;

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

}
main()
{
      int m,n,i,j,k,l,sum,t;
       scanf("%d",&m);
      while (m>1) 
      {
            if (m%2==1) 
            {
              printf("%d*3+1=%d\n",m,m*3+1);
              m=m*3+1;
              }
              else 
              {
                   printf("%d/2=%d\n",m,m/2);
                  m=m/2;
                  }
                  }
   printf("End");
     
       }
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 main(){
	int n;int i;
	cin>>n;
	if(n==1)cout<<"End"<<endl;else{
	for(i=1;;i++){
		if(n==1)break;
		if(n%2!=0){cout<<n<<'*'<<'3'<<'+'<<'1'<<'='<<3*n+1<<endl;
		n=3*n+1;
		}
		else {cout<<n<<'/'<<'2'<<'='<<n/2<<endl;
		n=n/2;
		}
	}
	cout<<"End"<<endl;}
	return 0;
}
int main()
{
int n,count=0;
scanf("%d",&n); /*??????*/
if(n==1)
printf("End");
else
{
do{
if(n%2)
{
n=n*3+1; /*?????n?3?1*/
printf("%d*3+1=%d\n",(n-1)/3,n);
}
else
{
n/=2; /*????n??2*/
printf("%d/2=%d\n",2*n,n);
}
}while(n!=1); /*n???1???????*/
printf("End");
}
}
void main()
{
	int n,i,x,m;
	scanf("%d",&n);
	x=n;
	for(i=1;i<=1000;i++)
	{
		if((x!=1)&&(x%2==1))
		{
			m=x*3+1;
			printf("%d*3+1=%d\n",x,m);
			x=m;
		}
		else if((x!=1)&&(x%2==0))
		{
			m=x/2;
			printf("%d/2=%d\n",x,m);
			x=m;
		}
		else if(x==1)
		{
			printf("End");
			break;
		}
	}
}
int main()
{
	int n,i,j;
	scanf("%d",&n);
	while(1)
	{		
		while(n%2==0)
		{printf("%d/%d=%d\n",n,2,n/2);
		n=n/2;}
		if(n==1) break;
		else
		{
			printf("%d*%d+%d=%d\n",n,3,1,(n*3+1));
			n=n*3+1;
		}
	}
	printf("End\n");
}
//10.12 ????
//???   1100012799
//??????
int main ()
{
	int num;
	cin>>num;
	if (num==1)      cout<<"End"<<endl;//?????1???????,????????
	else if (num!=1)//????1 ??????
	{
		do
		{
			if (num%2==0)//????
			{
				num=num/2;
				cout<<num*2<<"/2="<<num<<endl;//
			}
			else if (num%2==1)//????
			{
				num=num*3+1;
				cout<<(num-1)/3<<"*3+1="<<num<<endl;
			}
		}
		while (num!=1);//??????1?????
		cout<<"End"<<endl;
	}
	return 0;
}
void main ()
{
int n,n1,i,j,k;
scanf("%d",&n);
if(n==1) printf("End\n");


if(n!=1)
{
do
{
if(n%2==1)
{
n1=n*3+1;
printf("%d*3+1=%d\n",n,n1);
n=n1;
}
if(n%2==0)
{
n1=n/2;
printf("%d/2=%d\n",n,n1);
n=n1;
}
}while(n!=1);
printf("End\n");
}
}
/*************************
 ***??:??? 1200012776
 ***????:????
 ***??:2012?11?15?
 *************************/
int num(int a)	//????num????a???????
{
	if (a % 2 == 0)	//?a???
	{
		cout << a << "/2=" << a / 2 << endl;	//???
		return (a / 2);	//?num???a/2
	}
	else	//?a???
	{
		cout << a << "*3" << "+1=" << a * 3 + 1 << endl;	//???
		return (a * 3 + 1);	//?num??a*3+1
	}
}
int main()
{
	int a;
	cin >> a;
	while (a != 1)	//?a??1?????num
	{
		a = num(a);
	}
	cout << "End" << endl;
	return 0;
}
int main(int argc, char* argv[])
{
	int n;cin>>n;
	while(n!=1)
	{
		if(n%2==0)
		{
			cout<<n<<"/2="<<n/2<<endl;
			n/=2;
		}
		else
		{
			cout<<n<<"*3+1="<<n*3+1<<endl;
			n=n*3+1;
		}
	}

	cout<<"End";




	return 0;
}
int main()
{
   int i,j,m,n,s;
   m=0;
   int x[100];
   scanf("%d",&n);
   if(n==1)
   {
        printf("End");
        return 0;
    }
   else
    {
       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;
                }
           if(n==1)
              { printf("End");
                break;}
         }
      }
            return 0;
}
int main()
{
	int m,n,i,a,b,c,d,e,f,g;
	scanf("%d",&n);
    m=n;
	a=1;
	b=2;
	c=3;
	if(n==1)
	{
		printf("%s","End");
	}
	else
	{
	 while(n>1)
	 {
		if(n%2==0)
		{
			m=n/2;
			printf("%d%c%d%c%d\n",n,'/',b,'=',m);
			n=m;
		}
		else
		{
			m=n*3+1;
			printf("%d%c%d%c%d%c%d\n",n,'*',c,'+',a,'=',m);
            n=m;
		}
	 }
	printf("%s","End");
	 }
	return 0;
}