#include<stdio.h>
int cycle(int s,int n){
s++;
if (n==1){
return s;
}
else if (n%2!=0){
return cycle(s,3*n+1);
}
else{
return cycle(s,n/2);
}
}
int main(){
int n,m;
while(scanf("%d%d",&n,&m)!=EOF){
printf("%d %d ",n,m);
if (n>m){
int temp=n;
n=m;
m=temp;
}
int ans=0;
for (int i=n;i<=m;i++){
int s=0;
int temp=cycle(s,i);
if (temp>ans){
ans=temp;
}
}
printf("%d\n",ans);
}
return 0;
}