#include<iostream>
#include<cstdio>
void swap0(int&,int&);
int main(void)
{
using namespace std;
int n,n2,end;
while (scanf("%d",&n) != EOF) {
cin >> end;
if (end < n)
swap0(end, n);
n2 = n;
int max = 0;
for (; n <= end; n++) {
int n3 = n;
int count = 0;
while (n > 1) {
if (n % 2 == 0)
n /= 2;
else n = 3 * n + 1;
count++;
}
count++;
if (max < count)
max = count;
n = n3;
}
cout << n2 << " " << end << " "
<< max << endl;
}
return 0;
}
void swap0(int& a, int& b) {
int t;
t = a;
a = b;
b = t;
return;
}