semeru/Code-Code-CloneDetection-POJ104 huggingface dataset:
void f1(int a)
{ 
	int b;
	b = a * 3 + 1;
	cout<<a<<"*"<<3<<"+"<<1<<"="<<b<<endl;
}
void f2(int a)
{
	int b;
	b = a / 2;
	cout<<a<<"/"<<2<<"="<<b<<endl;;
}
int main()
{
	int x;
	cin>>x;
	while(x!=1)
	{
		if(x%2==0)
		{
		    f2(x);
		    x=x/2;
		}
	    if(x%2==1&&x!=1)
		{
            f1(x);
		    x=x*3+1;
		}
	}
	cout<<"End"<<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 main()
{
	int n,i,j,k,a,b;
	scanf("%d",&n);
	while(n!=1)
	{
		if(n%2==1)
		{
			k=n;
			n=3*n+1;
			printf("%d*3+1=%d\n",k,n);
		}
		else
		{
			k=n;
			n/=2;
			printf("%d/2=%d\n",k,n);
		}
	}
	printf("End\n");
}
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 n;

int main()
{
	scanf("%d",&n);
	while (n%2==1)
	{
		if(n==1)
		{
			printf("End");
			break;
		}
		printf("%d*3+1=",n);
		n=n*3+1;
		printf("%d\n",n);
		while(n%2==0)
		{
			printf("%d/2=",n);
			n=n/2;
			printf("%d\n",n);
		}
		if(n==1)
		{
			printf("End");
			break;
		}
	}
	while (n%2==0)
	{
		printf("%d/2=",n);
		n=n/2;
		printf("%d\n",n);
		if(n==1)
		{
			printf("End");
			break;
		}
		while (n%2==1)
		{
			printf("%d*3+1=",n);
			n=n*3+1;
			printf("%d\n",n);
		
	
		}
	}
	return 0;
}
int main()
{
int n,i,a[100];
cin>>n;
a[0]=n;
for(i=0;;i++){
	if(n-(n/2)*2==1&&n>2){
		a[i]=n*3+1;
		cout<<n<<"*3+1="<<a[i]<<endl;
	}
	if(n-(n/2)*2==0){
		a[i]=n/2;
		cout<<n<<"/2="<<a[i]<<endl;
	}
	n=a[i];
	if(a[i]==1)break;

}
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 main ()
{int n;
cin>>n;
if(n==1)
{cout<<"End";
goto ends;}
do
{if(n%2!=0)
{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;
}
}
while(n!=1);
cout<<"End";
ends:
return 0;
}
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 jg(int n)
{
	int i=0,j=0,k=0,tp=0;
	while(n>=1)
	{
	if(n==1)
	{cout<<"End";
	break;}
    else 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;}
	}
}

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

void f(int n);
int main ()
{
	int n;
	cin >> n;
	f(n); //????f
	return 0;
}
void f(int n)
{
	int m;
	if(n == 1) //?????n?1
		cout << "End";
	else
	{
		if(n % 2 == 0)
		{
			m = n / 2;
			cout << n << "/" << 2 << "=" << m << endl; //??n???,??"n/2=m"???
		}
		else
		{
			m = 3 * n + 1;
			cout << n << "*" << 3 << "+" << 1 << "=" << m << endl; //??n??????"n*3+1=m"???
		}
		f(m); //??
	}
	return;
}
/**
* @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 a;
	int b,i;
	scanf("%d",&a);
	b=a;
	for(i=0;b!=1;i++){
		if(a%2==0){
			b=a/2;
			if(i==0){
				printf("%d/2=%d",a,b);
			}
			else if (i!=0){
				printf("\n%d/2=%d",a,b);
			}
		}
		else if(a%2!=0) {
			b=a*3+1;
			if(i==0){
				printf("%d*3+1=%d",a,b);
			}
			else if(i!=0){
				printf("\n%d*3+1=%d",a,b);
			}
		}
		a=b;
	}
	printf("\nEnd");
	return 0;
}
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()
{
	int n,a,b;
	scanf("%d",&n);
	a=n;
	while(a!=1)
	{
		if(a%2!=0)
		{
			b=a*3+1;
			printf("%d*3+1=%d\n",a,b);
			a=b;
		}
		if(a%2==0)
		{
			b=a/2;
			printf("%d/2=%d\n",a,b);
			a=b;
		}
	}
	printf("End");
	return 0;
}
int main()
{
int m,n=0,y=0;
int i;
scanf("%d",&m);
n=m;
y=n;
    for(i=0;i<100;i++)
{
if(y==0||y==1)
{
printf("End\n");
break;
}
else
{
if(n%2==0)
{
            y=n/2;
printf("%d/2=%d\n",n,y);
n=y;
}
else 
{
y=n*3+1;
printf("%d*3+1=%d\n",n,y);
n=y;
}
//printf("%d\n",y);
}
}
return 0;
}
int main()
{
    int a,r,b;
    scanf("%d",&a);
    if(a==1)
    printf("End");
    else       
       { if (a%2==0)
       {r=a/2;
       b=r;
    printf("%d/2=%d\n",a,r);}
    else
    {r=(a*3)+1;
    b=r;
    printf("%d*3+1=%d\n",a,r);  }
while(b!=1)
    {  if (b%2==0)
              {r=b/2;
       
    printf("%d/2=%d\n",b,r);
    b=r;}
    else
    {r=b*3+1;
   
    printf("%d*3+1=%d\n",b,r);  
     b=r;}
    
    }printf("End");}
    getchar();
    getchar();    }
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,k;
  scanf("%d",&n);
  k=n;
  while(k!=1)
  {     if(n%2==0) 
  {     k=n/2;
	  printf("%d/%d=%d\n",n,2,k);
	  n=k;
  }
   else  
   {     k=n*3+1;
	   printf("%d*%d+%d=%d\n",n,3,1,k);
	   n=k;
   }
  }
  printf("End");
  return 0;
}
int main ()
{
    int n,m,YS; 
    cin>>n;//??n 
    if(n==1)cout<<"End";
    else
    {
        do
        {
           YS=n%2;//?????? 
           if(YS!=0)// ????????3?1
           {
                    m=n;
                    n=3*m+1;
                    cout<<m<<"*3"<<"+1="<<n<<endl; //?????? 
           }
           else// ?????????2
           {
               m=n;
               n=m/2;
               cout<<m<<"/2"<<"="<<n<<endl;//??????  
           }
         }while(n!=1);
         cout<<"End"; 
    }
cin.get();cin.get();cin.get();cin.get();    
return 0;   
}
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;
}
main(){
int a;
int b;
int c;
int d;
scanf("%d",&a);
b=a%2;

if(b==0)
{
while(b==0)
{
c=a/2;
b=c%2;
printf("%d/2=%d\n",a,c);
a=c;
}
if(a==1)
printf("End");
else{
while((b!=0)&&(a!=1))
{

d=a*3+1;
printf("%d*3+1=%d\n",a,d);
a=d;
b=a%2;
while(b==0)
{
c=a/2;
b=c%2;
printf("%d/2=%d\n",a,c);
a=c;
}

}

printf("End");
}
}


else
{
if(a==1)
printf("End");
else
{
while((b!=0)&&(a!=1))
{

d=a*3+1;
printf("%d*3+1=%d\n",a,d);
a=d;
b=a%2;
while(b==0)
{
c=a/2;
b=c%2;
printf("%d/2=%d\n",a,c);
a=c;
}

}

printf("End");
}

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

	
	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;
}
void main()
{
	int n,i,j,k,l,m;
	scanf("%d",&n);
	if(n==1) {printf("End");exit(1);}
	while (n!=1)
	{
		if (n%2==0) {k=n/2;printf("%d/2=%d\n",n,k);n=k;}
		else {k=n*3+1;printf("%d*3+1=%d\n",n,k);n=k;}
	}
	printf("End");
}
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;
        }
    }
}
int main()
{
    int a,b;
    cin>>a;
    while(a!=1)
    {
    if(a%2==1)
    {
    cout<<a<<"*3+1=";
    a=a*3+1;
    cout<<a<<endl;
    }
    else
    {
    cout<<a<<"/2=";
    a=a/2;
    cout<<a<<endl;
    }
    }
    cout<<"End"<<endl;    
}
main()
{
	int a,b,c,d;
	scanf("%d",&a);
	while(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");
}
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;
}
/*???1000012904_1.cpp
  ?????????
  ?????
  ???2010?12?1?
*/
void jiaogu(int n)//??????
{
	if(n == 1)//???????????n==1???End??
	{
		cout << "End" << endl;
		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;//????????
		}
		jiaogu(n);//????????????????????1????????1????
	}
}
int main()
{
	int n; 
	cin >> n;
	jiaogu(n);
	return 0;
}
int main()
{
	int n;
	int t=0;
	scanf("%d",&n);
	while(n!=1)
	{
		if (n%2==1)
		{
			t++;
			int e=n;
			n=3*n+1;
			if (t==1)
			{
				printf("%d*3+1=%d",e,n);
			}
			else if (t>1)
			{
				printf("\n%d*3+1=%d",e,n);
			}
			
		}
		else
		{
			t++;
			int e=n;
			n=n/2;
			if (t==1)
			{
				printf("%d/2=%d",e,n);
			}
			else if (t>1)
			{
				printf("\n%d/2=%d",e,n);
			}
		}
	}
	printf("\nEnd");
	
	
	return 0;

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

void JiaoGu ( int a)
{
	int b;
	if (a == 1)
		cout << "End" << endl;
	else if (a % 2 == 0)
	{
		b= a / 2;
		cout << a << "/2=" << b << endl;
		JiaoGu(b);
	}
	else 
	{
		b = a * 3 + 1;
		cout << a << "*3+1=" <<b<< endl;
		JiaoGu(b);
	}
}
int main(int argc, char* argv[])
{

    int n,x,y;
    scanf("%d",&n);

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

    if(n==1)
    printf("End\n");

    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;
   }
main()
{
      int m,n,e;
      scanf ("%d",&n);
      if (n==1)
      printf("End");
      else
      {
  do
 {    
      if (n%2==0)
      { 
      printf ("%d/%d=%d\n",n,2,m=n/2);n=n/2;}
      else
    { 
      printf ("%d*%d+%d=%d\n",n,3,1,e=n*3+1);n=n*3+1;
     } }
      while(n!=1);
      printf ("End\n");}
      getchar();getchar();getchar();
}
void main()
{
	int n,i,x;scanf("%d",&n);
	if(n!=1)
	for(i=0;;i++)
	{
		if(n%2==1)
		{
			x=n*3+1;
			printf("%d*3+1=%d\n",n,x);if(x==1)break;
			n=x;
		}
		else
		{
			x=n/2;
			printf("%d/2=%d\n",n,x);if(x==1)break;
			n=x;
		}
	}
	printf("End");
}
int main()
{
	int n, i, j, k, l;
	scanf("%d", &n);
	if(n==1)
	{
		printf("End");
		return 0;
	}
	do
	{
		if(n%2!=0)
		{
			k=n*3+1;
			printf("%d*3+1=%d\n", n, k);
			n=k;
		}
		if(n%2==0)
		{
			j=n/2;
			printf("%d/2=%d\n", n, j);
			n=j;
		}
	}while(n>1);
	printf("End");
	return 0;
}
void main()
{
	int i,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;
			}
		}
	}
}
/**
* @file 1.cpp
* @author ???
* @date 2011-11?06
* @description
* ??????:????
*/
// ??????ji???
int ji(int m)
{
	cout << m << '*' << 3 << '+' << 1;
	m = m * 3 + 1;
	cout << '=' << m << endl;
	return m; // ?m???n
}
// ??????ou???
int ou(int m)
{
	cout << m << '/' << 2;
	m = m / 2;
	cout << '=' << m << endl;
	return m;
}

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

	

}
int search(int a[][8],int m,int n)
{
	int i,j,k,x=0,y=0,max,sign;
	for(i=0;i<=m-1;i++)
	{
	
		for(j=0;j<=n-1;j++)
		{	max=a[i][0];
			
			if(max<a[i][j])
			{
				max=a[i][j];
				y=j;} 
		}
		for(k=0;k<=m-1;k++)
		{
			if(max>a[k][y])
			{
				x=-1;
			    break;
			}
			else
				x=i;
		}
        sign=10*x+y;
		if(sign>=0)return(sign);
	}
		return(-1);

}
main()
{
	int i,j,x,y,a[8][8],sign;
	scanf("%d,%d",&x,&y);
	for(i=0;i<=x-1;i++)
	{
		for(j=0;j<=y-1;j++)
		{
			scanf("%d",&a[i][j]);
		}
	}
	sign=search(a,x,y);
	if(sign<0)
		printf("No");
	else
	{
	i=sign%10;
	j=(sign-i)/10;
	printf("%d+%d",j,i);}
	
}
int main(){
int a,b,i,j,k,l,m,n,N=0;
int sz[10][10];
scanf("%d,%d",&a,&b);
for(i=0;i<a;i++){
	for(j=0;j<b;j++){
		scanf("%d",&sz[i][j]);
	}
}
for(i=0;i<a;i++){
	for(j=0;j<b;j++){
		m=0;
		n=0;
		for(k=0;k<a;k++){
			if(sz[i][j]<sz[k][j])
				m++;
		}
        for(l=0;l<b;l++){
			if(sz[i][j]>sz[i][l])
				n++;
		}
		if((m==a-1)&&(n==b-1)){
			printf("%d+%d\n",i,j);
			N++;
		}
	}
}
if(N==0)
printf("No");
return 0;
}