semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
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 main()
{
    int n,i;
	scanf("%d",&n);
	if(n==1){
		printf("End");
	}else{
		for(i=0;;i++){
			if(n%2==0){
				printf("%d/2=%d\n",n,n/2);
				n/=2;
			}else{
				printf("%d*3+1=%d\n",n,3*n+1);
				n=3*n+1;
			}
			if(n==1){
				break;
			}
		}
			printf("End\n");
	}

         
    return 0;
}
int main(){
    int a,b,c;
    cin>>a;
    while(a!=1){
    if(a%2==1)
    {cout<<a<<"*"<<3<<"+"<<1<<"="<<a*3+1<<endl;
    a=a*3+1;}
    else{ 
    cout<<a<<"/"<<2<<"="<<a/2<<endl;
    a=a/2;}
    
}
 cout<<"End"<<endl;
          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 main()
{
	int n,m,p;
		cin>>n;
		
	if(n==1)
		cout<<"End";
	if(n!=1)
	{	while(1)
		{
		if(n%2==1)
		{
			m=n*3+1;
		cout<<n<<"*3"<<"+1"<<"="<<m<<endl;
		n=m;
		}
		else
		{	p=n/2;
		cout<<n<<"/2"<<"="<<p<<endl;
		n=p;}
		if(n==1)break;
		}
	cout<<"End";}

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

int main(void)
{
	int n;
	cin>>n;
	f(n);
	return 0;
}
// ????.cpp : ??????????????
//



void out(int);

int main()
{
	int n = 0;

	cin >> n;

	out(n);

	return 0;
}


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

}
/*
 * 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 ()
{
    int n,a;
    cin >> n;
    while (n!=1)
    {
        if (n%2==0)
        {
            a = n/2;
            cout << n <<"/2="<< a << '\n';
            n = n/2;
        }
        else
        {
            a = n*3+1;
            cout << n <<"*3+1="<< a <<'\n';
            n = n*3+1;
        }
    }
    cout << "End";
    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);
	}
}
/*??
???????????????????
????????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" */
void JIAOGU(int NUM)
{
	int NEXT;
	if (NUM==1)
	{
		printf("End");
		return;
	}
	else if(NUM%2==1)
	{
		NEXT=3*NUM+1;
		printf("%d*3+1=%d\n",NUM,NEXT);
		JIAOGU(NEXT);
	}
	else
	{
		NEXT=NUM/2;
		printf("%d/2=%d\n",NUM,NEXT);
		JIAOGU(NEXT);
	}
}
int main()
{
	int NUM;
	cin>>NUM;
	JIAOGU(NUM);
	return 0;
}
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 n;
	cin >> n;
	for (;;) {
		if (n == 1) {
			cout << "End";
			break;
		}
		else if (n % 2 == 0) {
			cout<<n<<"/"<<"2=";
			n = n / 2;
			cout<<n<<endl;
			continue;
		}
		else {
			cout<<n<<"*3+1=";
			n=n*3+1;
			cout<<n<<endl;
		}
	}
}
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 main() {
	int a[10000];
	int i,j;
	scanf("%d",&a[0]);
	if(a[0]==1){
		printf("End\n");
	}else{
		for(i=0;a[i]!=1;i++){
			if(a[i]%2==1){
				a[i+1]=a[i]*3+1;
				printf("%d*3+1=%d\n",a[i],a[i+1]);
			}else{
				a[i+1]=a[i]/2;
				printf("%d/2=%d\n",a[i],a[i+1]);
			}
		
			}
		printf("End\n");
	}
}
void main()
{
int a,b;
scanf("%d",&a);
for(a=a;a!=1;)
{
 if(a%2==0){b=a/2;printf("%d/2=%d\n",a,b);a=b;}
else if(a%2!=0){b=a*3+1;printf("%d*3+1=%d\n",a,b);a=b;}
}if(a==1)printf("End");
}
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;
}
void f(int n)
{
	if (n % 2)
	{
		cout << n << '*' << 3 << '+' << 1 << '=' << n * 3 + 1 << endl;
		n = n * 3 + 1;
	}
	else 
	{
		cout << n << '/' << 2 << '=' << n/2 << endl;
		n = n / 2;
	}
	if (n == 1)
		cout << "End";
	else 
		f(n);
}
int main ()
{
	int n;
	cin >> n;
	if (n == 1)
		cout << "End";
	else
		f(n);
}
int main()
{
 int x;
 scanf("%d",&x);
 while (x%2==0)
 {
     x=x/2;
     printf("%d/2=%d\n",x*2,x);
     while (x%2!=0 && x!=1)
     {
         x=x*3+1;
         printf("%d*3+1=%d\n",(x-1)/3,x); 
         }
     } 
 
 while (x%2!=0 && x!=1)
 {
       x=x*3+1;
       printf("%d*3+1=%d\n",(x-1)/3,x);
       while (x%2==0)
       {
             x=x/2;
             printf("%d/2=%d\n",x*2,x); 
             } 
       }
 if (x==1) printf("End\n"); 
 
}
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,m;
	scanf("%d",&n);
	while(1)
	{
		if(n==1)
		{
			printf("End");
			break;
		}
		if(n%2==0)
		{
			m=n/2;
			printf("%d/2=%d\n",n,m);
			n=m;
			if(n==1)
		    {
			    printf("End");
			    break;
		    }
		}
		if(n%2==1)
		{
			m=n*3+1;
			printf("%d*3+1=%d\n",n,m);
			n=m;
			if(n==1)
		    {
			    printf("End");
			    break;
		    }
		}
	}
	scanf("%d",1);
	return 0;
}
int main()//???
{
	int n;//????????
	cin>>n;//??n
	for (int k=0;k<2000;k++)
	{
		if (n==1)
		{cout<<"End";
		break;//?n=1,???End??????
		}
		else if(n%2)
		{int temp0=n;
		n=n*3+1;
		cout<<temp0<<"*3+1"<<"="<<n<<endl;//?n???????3n+1,??????
		}
		else 
		{int temp1=n;
		n=n/2;
		cout<<temp1<<"/2="<<n<<endl;//?n???????n/2???????
		}
	}
	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);
	}
}
void s(int n)
{
	int a,b;
	if(n%2==1)
	{
		a=3*n+1;
		cout<<n<<"*3+1="<<a<<endl;
	}
	if(n%2==0)
	{
		b=n/2;
		cout<<n<<"/2="<<b<<endl;
	}
}//s????????
int t(int n)
{
	if(n%2==0)
		return n/2;
	if(n%2==1)
		return 3*n+1;
}//t??????n?
int main()
{
	int i,n;
	cin>>n;
	while(n!=1)
	{
	    s(n);
	    n=t(n);
	}
          cout<<"End"<<endl;
	return 0;
}
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;
}
int main()
{int n;
 cin>>n;
 for(;n!=1;)
 {for(;n%2==0;)
 {cout<<n<<"/2="<<n/2<<endl;
 n=n/2;}
 for(;n%2==1&&n!=1;)
 {cout<<n<<"*3+1="<<3*n+1<<endl;
 n=3*n+1;}
}
cout<<"End"<<endl;
return 0;
}
int main()
{
	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*=3;
			n++;
		}
	}
	cout<<"End"<<endl;//??End
}
int main ()
{
	int n = 0;										//????n
	int x = 0;										//?????
	cin >> n;
	int y = 0;										//????
	for (;;)
	{
		if ( n == 1 ) 
		{
			cout << "End";
			break;
		}
		else
		{
			y = n % 2;
			if ( y == 1 ) 
			{
				x = n * 3 + 1;
				cout << n << "*3+1=" << x << endl;
			}
			else
			{
				x = n / 2;
				cout << n << "/2=" << x << endl;
			}
			n = x;
		}
	}
	return 0;
}
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;
}
/*??????
 *?????function2-1.cpp
 *Created on: 2012-11-25
 *???????
 */
void f(int);
int a,b,i,j;//????

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

void f(int x)
{
	if (x==1)//x=1???
		{cout << "End" << endl;return;}
	if (x%2==1)
	{cout << x <<"*3+1=" <<3*x+1 << endl;return f(3*x+1);}//x??????
	if (x%2==0)
	{cout << x <<"/2=" << x/2 << endl;return f(x/2);}//x??????
	}
int main(){
    int n,i,k,s[10000];
	int a=0,b,c;
	scanf("%d",&n);
	s[0]=n;
	if(n==1){
		printf("End");
	}
	if(n!=1){
	for(i=1;;i++){
		if(s[i-1]%2==1){
			s[i]=3*s[i-1]+1;
			printf("%d*3+1=%d\n",s[i-1],s[i]);
		}
		if(s[i]==1){
			printf("End");
			break;
		}
		if(s[i-1]%2==0){
			s[i]=s[i-1]/2;
			printf("%d/2=%d\n",s[i-1],s[i]);
		}
		if(s[i]==1){
			printf("End");
			break;
		}
	}
	}


		

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

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


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

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

		a=b;
		b=0;
	}
	while (a!=1);
	if (a==1) printf("End\n");
	}
	return 0;
}
int main()
{
  int n,i,j;
   int s[1000];
   scanf("%d",&n);
   for(i=0;;i++){
       s[0]=n;
if(s[i]>1){
       if(s[i]%2==0){
          s[i+1]=s[i]/2;
          printf("%d/2=%d\n",s[i],s[i+1]);
       }else{
           s[i+1]=3*s[i]+1;
           printf("%d*3+1=%d\n",s[i],s[i+1]);
       }
}else{
printf("End");
break;
}
   }
     return 0;
}
int main()
{
	int i,n,t=2,l,j;
	scanf("%d",&n);
	for(i=0;n!=1;i++){
		if(n%2==0){
			printf("%d/2=%d\n",n,n/2);
			t=0;
		}
		else{
			printf("%d*3+1=%d\n",n,n*3+1);
			t=1;
		}
		if(t==0){
			n=n/2;
		}
		if(t==1){
			n=n*3+1;
		}
	}
	printf("End");
			

	return 0;
}
main()
{
	int a,b,c,d;
	scanf("%d",&a);
	b=2;
	if(a>1){
	do {c=a%b;
		if(c==1)
	    {
		d=a*3+1;
		printf("%d*3+1=%d\n",a,d);
		a=d;
		}
		else
		{d=a/2;
		   if(d>=1)
		    {printf("%d/2=%d\n",a,d);
		    a=d;}
		   else
		    a=d;
	    }
		
} while(a>1);
  printf("End");
}
  else
  printf("End");
}
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 main(){
	int n,j,i;
	scanf("%d",&n);
for(;n!=1;){
	if(n%2==0){ printf("%d/2=",n); n=n/2; 	printf("%d",n);}
	 else{  printf("%d*3+1=",n); n=n*3+1; 	printf("%d",n);}
	 printf("\n");}
	printf("End");
	return 0;
}
main()
{
 int a,b;
 scanf("%d",&a);
 if(a==1)
  printf("End");
 else
 {
  while(a!=1)
 {
  while(a%2==0)
 {
  b=a/2;
  printf("%d/2=%d\n",a,b);             
  a=b;
 }
 while(a%2!=0 && a!=1)
 {
  b=a*3+1;
  printf("%d*3+1=%d\n",a,b);
  a=b;             
 }
 }
 printf("End");
 }     
}
int main()
{
	int i,j,k,m,n;
	scanf("%d",&n);
	if(n==1)
	printf("End\n");
	else
	{
		for(i=n;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\n");
	}
}
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);
}
int main()
{
	int k;
	cin >> k;
	while(k!=1)//???1
	{
		if(k%2){
			cout << k;
                            cout <<"*3+1="<<(k=3*k+1)<<endl;//??
		}else{
			cout << k ;
                            cout<< "/2="<<(k/=2)<<endl;//??
	}}
	cout << "End"<<endl;
	return 0;
}
int main()
{
    int n,i,a[100];
    cin>>n;
    a[0]=n;
    for(i=0;i<100;i++)
    {
        if(a[i]%2==1&&a[i]!=1)  
        {
           a[i+1]=a[i]*3+1;
            cout<<a[i]<<"*3+1="<<a[i+1]<<endl;
            }
        if(a[i]%2==0)
          {
            a[i+1]=a[i]/2;
            cout<<a[i]<<"/2="<<a[i+1]<<endl;
            }
        if(a[i]==1)
        {
           cout<<"End";
           break;
           }
        }
        return 0;
        }
void main()
{
	int a,b;
	scanf("%d",&a);
	while(a!=1){
		if(a%2==1) { printf("%d*3+1=",a);a=a*3+1;printf("%d\n",a);}
		else if(a%2==0){ printf("%d/2=",a);a=a/2;printf("%d\n",a);}
	}
	printf("End");
}
int main()
{
	int n,t,i,m;
	scanf("%d",&n);
	if(n==1)
	{
		t=n;
	}
    
	else if(n%2==0)
	{
		t=n/2;
		printf("%d/2=%d\n",n,t);
	}
	else if(n!=1&&n%2!=0)
	{
		t=n*3+1;
		printf("%d*3+1=%d\n",n,t);
	}
	while(t!=1)
	{
		if(t%2==0)
		{
			m=t/2;
			printf("%d/2=%d\n",t,m);
			t=m;
		}
		else
		{
			m=t*3+1;
			printf("%d*3+1=%d\n",t,m);
			t=m;
		}
	}
	printf("End");
	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 main()
{
	int n=0;
	cin>>n;
	 while(n!=1)
	 {
		if(n%2==0)              //n?????n/2???
		{
			cout<<n<<"/2="<<n/2<<endl;
			n=n/2;
			continue;
		}
		if(n%2!=0)                  //n?????n*3+1???
		{
			cout<<n<<"*3+1="<<n*3+1<<endl;
			n=n*3+1;
			continue;
		}
	 }
	cout<<"End";            //??END
	cin.get();cin.get();cin.get();
	return 0;
}
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;
}
void main()
{
	int x,y;
	scanf("%d",&x);
	while(x!=1)
	{
	    if(x%2==0)
		{
	  	   y=x/2;
		   printf("%d/2=%d\n",x,y);
		   x=y;
		   continue;
		}
		if(x%2!=0)
		{
			y=x*3+1;
			printf("%d*3+1=%d\n",x,y);
			x=y;
		}
	}
	printf("End");
}
/*
 * 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;
}
int one(int n)
{
	if(n!=1)
	{
		if(n%2!=0)
		{
			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;
		}
	}
	else
	{
		n=-1;
		printf("End");
	}
	return n;
}
int main()
{
	int n;
	scanf("%d",&n);
	do
	{
		n=one(n);
	}
	while(n!=-1);
	return 0;
}
int shu(int a);

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



int shu(int a){
	int q;
	if(a%2==0){
			q=a/2;
            printf("%d/2=%d\n",a,q);
			return q;
		}
	if(a%2!=0){
			q=a*3+1;;
            printf("%d*3+1=%d\n",a,q);
			return q;
		}
	}
int main()
{
	int n;
	cin>> n;
	if(n==1) {cout<<"End";}   //??????1?????
	while(n!=1)
	{
		if(n%2==0) {n=n/2;cout<< 2*n <<"/2="<< n <<endl;}  //???????????2
		else if(n%2!=0) {n=n*3+1;cout<< (n-1)/3 <<"*3+1="<< n <<endl;} //??????????3?1
		if(n==1)  {cout<<"End";break;} //????1???
	}
	return 0;
}