/*#include <stdio.h>
struct p
{
int math;
int information;
int count;
};
int main ()
{
struct p st[1001];
struct p temp;
int n,i,j,cnt=0;
scanf ("%d",&n);
for (i=0; i<n; i++)
{
scanf ("%d %d",&st[i].math,&st[i].information);
st[i].count = i+1;
}
for (i=0; i<n; i++)
{
for (j=0; j<n-1; j++)
{
if (st[j].math < st[j+1].math)
{
temp = st[j];
st[j] = st[j+1];
st[j+1] = temp;
}
/*if(st[i].information < st[i+1].information)
{
temp = st[i];
st[i] = st[i+1];
st[i+1] = temp;
}
}
}
for (i=0; i< n; i++)
{
printf ("%d %d %d\n",st[i].count,st[i].math,st[i].information);
}
return 0;
}
*/
#include<stdio.h>
void rec(int n)
{
if(n%2 == 0)
{
printf("%d\n",n/2);
return rec (n/2);
}
else if(n == 1)
{
return 1;
}
else
{
printf("%d\n",3*n+1);
return rec(3*n+1);
}
}
int main()
{
int a,b;
scanf ("%d %d", &a, &b);
for(a<=n)
{
for(m<=b)
{
if(n<m)
{
printf("%d",n);
}
else
{
printf("%d",m);
}
}
}
rec(a);
return 0;
}