semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
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;
scanf("%d",&n);
for(int i=1;;i++){
if(n!=1){
	if(n%2!=0){
		n=3*n+1;
	printf("%d*3+1=%d\n",(n-1)/3,n);
	}
	if(n%2==0){
		n=n/2;
	printf("%d/2=%d\n",2*n,n);
	}
	}
else
break;
}
printf("End");
	return 0;
}
int main(){
int n,i,t[1000];
scanf("%d",&n);
t[0]=n;
for(i=0;t[i]!=1;i++){
if(t[i]%2==0){t[i+1]=t[i]/2;printf("%d/2=%d\n",t[i],t[i+1]);}
else{t[i+1]=3*t[i]+1;printf("%d*3+1=%d\n",t[i],t[i+1]);}
}
printf("End\n");
return 0;
}
/*
 * hanshuzuoye1.cpp
 *
 *  Created on: 2013-11-21
 *      Author: Administrator
 */
int v(int n)
{    
	if(n==1)
		cout<<"End";
	else
		if(n%2==1)
	{
		cout<<n<<"*3+1="<<n*3+1<<endl;
		if(n*3+1==1)
			cout<<"End";
		else
		    return v(n*3+1);
	}
	if(n%2==0)
	{
		cout<<n<<"/2="<<n/2<<endl;
		if(n/2==1)
			cout<<"End";
		else
			return v(n/2);
	}
}
int main()
{
	int a;
	cin>>a;
	v(a);
}
/*
???????????????????????????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*/
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;
}
//****************************************
//*???????                       
//*?????? 1100012789      
//*???2011.11.14                       
//****************************************

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

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

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

}
void main()
{
int n,i=0,c,d,e,f;
scanf("%d",&n);
if(n==1)
	printf("End\n");
else
{
while(i!=1)
{
	if(n%2!=0)
	{
		c=3*n+1;
		d=n;
		n=c;
		printf("%d*3+1=%d\n",d,c);
	}
	else
	{
		e=n/2;
		f=n;
		n=e;
		i=e;
		printf("%d/2=%d\n",f,e);
	}
}
printf("End\n");
}
}
int main()
{
	int num,i,odd,even;//????num,????,?????????
	cin>>num;
	for(i=0;;i++)
	{
		if(num%2==0)//?????????2
		{ 
			even=num;
			num=num/2;
			cout<<even<<"/2="<<num<<endl;
		}
		if(num%2==1&&num!=1)//????????1???3+1
		{
			odd=num;
			num=num*3+1;
			cout<<odd<<"*3+1="<<num<<endl;
		}
		if(num==1)//???1  ??
		{	
			cout<<"End";
			break;
		}
	}
	return 0;
}
int main()
{
    int a,b,i;
    cin>>a;
    for(i=1;a!=1;i++)//?a==1??? 
    {
                    if(a%2==1) {b=a*3+1;cout<<a<<"*3+1="<<b<<endl;a=b;}//???????? 
                    else {b=a/2;cout<<a<<"/2="<<b<<endl;a=b;}}//???????? 
                    cout<<"End"<<endl;
                    return 0;
}
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 i,j,k;
	int n,m;
	scanf("%d",&n);
	for(;;)
	{
		if(n==1)
		{
			printf("End");
			break;
			}
		
		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;
		}
		}
	
	
	}
int main(){
    int n, m, i;
    scanf("%d",&n);
    for(i=0;;){
        if(n==1){
            printf("End");
            break;
        }
        if(n%2!=0){
            m=n*3+1;
            printf("%d*3+1=%d\n",n,m);
            i=n;
            n=m;
            m=i;
        }
        if(n%2==0){
            m=n/2;
            printf("%d/2=%d\n",n,m);
            i=n;
            n=m;
            m=i;
        }
    }
    return 0;
}
/*
 * jiaogucaixing.cpp
 * ??????
 * ????: 2012-11-25
 * ?????????
 */
int  print(int x)//?????????
{
	if(x==1){cout<<"End"<<endl;return 0;}
	if(x%2==0)cout<<x<<"/2="<<x/2<<endl;
	if(x%2==1)cout<<x<<"*3+1="<<x*3+1<<endl;
	return 0;
}
int number(int x){//??????????
	if(x==1) {print(x);return 0;}
	if(x%2==0){print(x);return number (x/2);}
	else {print(x);return number(x*3+1);}
}
int main(){
	int x;//????
	cin>>x;//??x??
	number(x);//????
	return 0;//????
}
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");
      
      }
/*            ????
??????        2010.12.06        */

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

int main()
{
	int n;
	cin >> n;
	f(n);//???????
	return 0;
}
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 main(){
	int n;
	cin>>n;
	while(n!=1){
		if(n%2){
			int t=n*3+1;
			cout<<n<<"*3+1="<<t<<endl;
			n=n*3+1;
		}
		else{
			int t=n/2;
			cout<<n<<"/2="<<t<<endl;
			n=n/2;
		}
	
	}
	cout<<"End"<<endl;
	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 main()
{
	int n,a,b,i;
	scanf("%d",&n);
	for(i=0;;i++)
	{
		if(n==1) break;
		if(n%2==0)
		{
			n=n/2;
			printf("%d/2=%d\n",2*n,n);
		}
		else
		{
			n=n*3+1;
			printf("%d*3+1=%d\n",(n-1)/3,n);
		}
	}
	printf("End\n");
	return 0;
}
int main(){
  int n,i,j,k;
  scanf("%d",&n);
  if(n==1){
	  printf("End\n");
  }
  else{while(n!=1){
	  if(n%2==0){j=n/2; printf("%d/2=%d\n",n,j);}
  else {j=n*3+1;printf("%d*3+1=%d\n",n,j);}
  n=j;
  }printf("End\n");}
  
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;
}
int main()
{
	int n;
	cin>>n;
	if(n==1)
		cout<<"End"<<endl;
	else
	{
		do
		{
			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;
			}
		}
		while(n!=1);
		cout<<"End"<<endl;
	}
	return 0;
}
int main(){
	int n,m,i,j,k,l;
	scanf("%d",&n);
	for(i=0;n!=1;i++)
	{
		if(n%2==0)
		{
			m=n/2;
			printf("%d/2=%d\n",n,m);
			n/=2;
		}
		else if(n%2!=0)
		{
			m=n*3+1;
			printf("%d*3+1=%d\n",n,m);
			n=n*3+1;
		}
	}
	printf("End");
	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);
	}
}
void d(int);
int main()
{
	int a;
	cin>>a;
	d(a);
	return 0;
}
void d(int a)
{
	while(a!=1)
	{
		if(a%2==0)
		{
			cout<<a<<"/2="<<a/2<<'\n';
			a=a/2;
		}
		else
		{
			cout<<a<<"*3+1="<<a*3+1<<'\n';
			a=a*3+1;
		}
	}
	cout<<"End"<<endl;
}
/*
  *@ title:????
  *@ date:2010-12-3
  *@ author:1000012899 ???
  *@ description: ???????
*/
void jg(int);
int main()
{
    int n;
    cin >> n;
    if (n == 1) cout <<"End";
    else jg(n);
    return 0;
}
void jg(int m)
{
    if (m % 2 == 1) 
    {
        cout << m << "*3+1=" ;
        m = m * 3 + 1;
        cout << m << endl;
    }
    else 
    {
        cout << m << "/2=" ;
        m = m / 2;
        cout << m << endl;
    }
    if (m == 1) 
    {
        cout <<"End";
        return;
    }
    else jg(m);
}
main()
{
	unsigned int i;
	scanf("%d",&i);
	  do{
	  if(i%2==1&&i!=1)
	  i=3*i+1,printf("%d*3+1=%d\n",(i-1)/3,i);
	  else if(i%2==0)
	  i=i/2,printf("%d/2=%d\n",2*i,i);
	  else
	  ;
	  }while(i!=1);
	  printf("End");
}
int main()
{
   int i,a[10000],n;
   scanf("%d",&i);
   
   if(i==1) printf("End\n");
   else {
        for(n=2;;n++)
        {
                a[1]=i;
                   if (a[n-1]%2==1) {a[n]=a[n-1]*3+1 ;printf("%d*3+1=%d\n",a[n-1],a[n]);}
                   else if(a[n-1]%2==0) {a[n]=a[n-1]/2;printf("%d/2=%d\n",a[n-1],a[n]);}
                 if (a[n]==1) { printf("End\n"); break;}
                   }}
                
                   
                   }
int main()
{
    int k,a,i;
    cin>>a;
    if(a==1)
    cout<<"End"<<endl;
    if(a!=1)
    {for(i=0;a!=1;i++)
     {
         
         if (a%2==1)
           {
                    k=a*3+1;
                    cout<<a<<"*"<<"3"<<"+"<<"1"<<"="<<k<<endl;
           }
         else
           {
                    k=a/2;
                    cout<<a<<"/"<<"2"<<"="<<k<<endl;
           }
           a=k;
         if(k==1)
         {cout<<"End"<<endl;
         break;}
         
     }
    }
    return 0;
}
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;
}
int jg(int);
int main()
{
    int n;
    cin >> n;
    while(n != 1)
    {
        if(n % 2 == 0)
        {
            cout << n << "/" << 2 << "=" << jg(n) << endl;
        }
        if(n % 2 != 0)
        {
            cout << n << "*" << 3 << "+" << 1 << "=" << jg(n) << endl;
        }
        n = jg(n);
    }
    cout << "End";

    return 0;
}

int jg(int x)
{
    if(x % 2 == 0)
    {
        return x / 2;     
    }
    else
    return 3 * x + 1;
}
main()
{ int n,k,i,j,*a,t,s,p;
  scanf("%d",&n);
  while(n!=1)
  { if(n%2==0)
    { printf("%d/2=%d",n,n/2);

    n=n/2;
    }
    else if(n%2!=0){
    printf("%d*3+1=%d",n,n*3+1);
    n=n*3+1;
    }
    printf("\n");
  }
  printf("End");
}
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;
}
int main(){  
int n,i;  
scanf("%d",&n);  
i=n;  
while(i>1)  {		   	
if(i%2!=0){				
printf("%d*3+1=%d\n",i,i*3+1);				
i=i*3+1;}		
if(i%2==0){			
printf("%d/2=%d\n",i,i/2);			
i=i/2;}			   
}   
printf("End");	
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 main()
{
	int k;
	scanf("%d",&k);
	while(k!=1)
	{
		printf("%d",k);
		if(k%2==1)
		{
			k=k*3+1;
			printf("*3+1=%d\n",k);
		}
		else
		{
			k=k/2;
			printf("/2=%d\n",k);
		}
	}
	printf("End");
}
main()
{
int n;
scanf("%d",&n);
while (n!=1)
{
if (n%2==1)
printf("%d*3+1=%d\n",(n-1)/3,n=n*3+1);
else 
printf("%d/2=%d\n",n*2,n=n/2);
}
printf("End");
}
int main()
{
	int n;
	cin>>n;
	while(n>1)//?while????????n>1
	{
		switch(n%2)//?switch???????
		{
		case 0://?????????
		  n=n/2;cout<<n*2<<"/"<<2<<"="<<n<<endl;
		  break;
		case 1://?????????
			n=n*3+1;
		    cout<<(n-1)/3<<"*"<<3<<"+"<<1<<"="<<n<<endl;
			break;
		}
	   
	}
	cout<<"End";
	return 0;
}
int main(){
	int n,i,j;
	scanf("%d",&n);
	for(j=1;j<=100;j++){
		if(n%2==0){
			i=n/2;
			printf("%d/2=%d\n",n,i);
			n=i;
		}
		if(n%2==1&&n!=1){
			i=3*n+1;
			printf("%d*3+1=%d\n",n,i);
			n=i;
		}
		if(n==1){
			printf("End\n");
			break;
		}
		j=j;
	}
	return 0;
}
main()
{
      int n,a;
      scanf("%d",&n);
       while (n-1>0)
      {  if (n%2==0)
      { n=n/2;
          a=2*n;
          printf("%d/2=%d\n",a,n); 
      }   
      else
      {  n=3*n+1;
         a=(n-1)/3;
         printf("%d*3+1=%d\n",a,n); 
      }   
      
      }   printf("End");  
      
}
int main()
{
    int n,n0,nl;
    cin>>n0;
    n=n0;
    for(;n!=1;)
    {
        nl=n;
        if(n%2==1)
        {
            n=3*n+1;
            cout<<nl<<"*3+1="<<n<<endl;
        }
        else
        {
            n=n/2;
            cout<<nl<<"/2="<<n<<endl;
        }
    }
    cout<<"End";
    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 a,t;
	int i,j;
	scanf("%d",&a);
	if(a==1)
	{
		printf("End\n");
	}
	else 
	{
		for(;a!=1;)
		{
			if(a%2!=0)
			{	
				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;
			}
		}
		if(a==1)
		{
		printf("End\n");
		}
	}

	
	
	
	return 0;
}
int main(){
	int n,i,a[10000];
	scanf("%d",&n);
	if(n==1){
			printf("End\n");
	}
	a[1]=n;
	if(n!=1){
		for(i=1; ;i++){
		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;
			}
		}
		if(a[i]%2!=0){
			if(a[i]==1){
				break;
			}
			a[i+1]=a[i]*3+1;
			printf("%d*3+1=%d\n",a[i],a[i+1]);
		}
	}
			printf("End\n");
	}
	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 n;                                                       //????
	cin>>n;                                                      //????
	while(n!=1)                                                  //????
	{
		if(n%2==1)                                               //????
			cout<<n<<"*3"<<"+1="<<3 * n + 1<<'\n',n = 3 * n + 1; //????
		else                                                     //????
			cout<<n<<"/2="<<n / 2<<'\n',n /= 2;                  //????
	} 
	cout<<"End"<<endl;                                           //????
	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 main() 
{
int a; 
scanf ("%d",&a);
if(a!=1)
{
while (a!=1)
{
if (a%2==0)
{
printf ("%d/2=%d\n",a,a/2);
a=a/2;
}
else 
{
printf ("%d*3+1=%d\n",a,3*a+1);
a=3*a+1;
}
;
}
;
}
else;
printf ("End\n");
}
void Try(int n)
{
	if(n==1)
		cout<<"End";
	else
	{
	if(n%2==0)
	{
		cout<<n<<"/2="<<n/2<<endl;
		Try(n/2);
	}
	else
	{
		cout<<n<<"*3"<<"+1="<<3*n+1<<endl;
		Try(3*n+1);
	}	
	}
}
int main()
{
	int n;
	cin>>n;
	Try(n);
	return 0;
}
int f(int), g(int);                  //????

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

    return 0;
}

int f(int a)
{
    int m;
    m = a * 3 + 1;                    //?3?1

    return m;
}

int g(int a)
{
    int m;
    m = a / 2;                        //??2

    return m;
}
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);
}
main()
{
int a,b;
scanf("%d",&a);
while (a!=1)
{
if(a%2==0)
{
b=a/2;
printf("%d/2=%d\n",a,b);
a=b;
}
else
{b=3*a+1;
printf("%d*3+1=%d\n",a,b);
a=b;
}
}
printf("End");
getchar();
getchar();
}
int main(){
	int n,i;
	scanf("%d",&n);
	if(n!=1){
		while(1){
			if(n%2!=0&&n!=1){
			    n=n*3+1;
			    printf("%d*3+1=%d\n",(n-1)/3,n);
			}else if(n%2==0&&n!=1){
		    	n=n/2;
		    	printf("%d/2=%d\n",2*n,n);
			}else if(n==1){
				printf("End");
			    break;
			}
		}
	}else if(n==1){
		printf("End");
	}
    return 0;
}
void main()
{
	int a,n,i,t;
	scanf("%d",&a);
	if(a==1) printf("End");
	else
	{
	while(a!=1)
	{
		if(a%2==1)
		{
			t=a*3+1;
			printf("%d*3+1=%d\n",a,t);
			a=t;
		}
		if(a%2==0)
		{
			t=a/2;
			printf("%d/2=%d\n",a,t);
			a=t;
		}
	}
	printf("End");
	}
	
}
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;
}
void num(int a)
{
	int m;
	do
	{
		if (a % 2 != 0)
		{
			m = a;
			a = a * 3 + 1;
			cout <<m << "*3+1=" << a <<'\n';
		}
		else 
		{
			m = a;
			a = a / 2;
			cout << m << "/2=" << a <<'\n';
		}
	} while (a > 1);
	if (a == 1)
		cout << "End";
}

int main()
{
	int a;
	cin >> a;
	if(a == 1)
		cout << "End";
	else
		num(a);
	return 0;
}
main()
{
 int i,n;
 scanf("%d",&n);
 for(i=n;i!=1;)
 {
  if(n==1)
  {
 printf("End");
  break;
 }
  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("End");
}
int main()
{
	int n,i,x,y;
	scanf("%d",&n);
	if(n>1)
	{
	  do{
		if(n%2==1)
		{
			x=0;
			x=3*n+1;
			printf("%d*3+1=%d\n",n,x);
			n=x;
		}
		else if(n%2==0)
		{
			y=0;
			y=n/2;
			printf("%d/2=%d\n",n,y);
			n=y;
		}
	}while(n>1);
	printf("End");
	}
	else if(n=1)
	{
	printf("End");
	}
	return 0;
}
int main()
{
    int n,count=0; cin>>n;
    int a[10000];
    while (n>1)
    {
        count++;
        if (n%2==0) {printf("%d/2=%d\n",n,n/2); a[count]=1,n=n/2;}
        else {printf("%d*3+1=%d\n",n,n*3+1);  a[count]=2,n=n*3+1;}
    }
    cout<<"End";


    return 0;
}