#include <stdio.h>
int memo[10000000] = {0};
int abc(int a)
{
if(memo[a]!=0)
{
return memo[a];
}
if(a==1)
{
return memo[a] = 1;
}
if(a%2==0)
{
memo[a] = a/2;
}
else if(a%2!=0)
{
memo[a]= (a*3)+1;
}
}
int main()
{
int a,b,c,i;
scanf("%d %d", &a, &b);
for(i=a;i<=b;i++)
{
abc(i);
}
}