#include <iostream>
using namespace std;
int get_count(int a)
{
int count=1;
while(a!=1)
{
if(a%2)
a=3*a+1;
else
a=a/2;
count++;
}
return count;
}
int main()
{
int n,m;
while(cin>>n>>m)
{
int max=get_count(n);
int i,j;
if(n>m)
{
i=m;
j=n;
}
else
{
i=n;
j=m;
}
for(int k=i;k<=j;k++)
{
if(max<get_count(k))
max=get_count(k);
}
cout<<n<<" "<<m<<" "<<max<<endl;
}
return 0;
}