#include <iostream>
using namespace std;
int length(int ch) {
int it = 1;
while (ch != 1) {
if (ch % 2 == 1) {
ch = ch * 3 + 1;
}
else {
ch = ch / 2;
}
it++;
}
return it;
}
int main() {
int i, j;
while(cin >> i) {
cin >> j;
int it, maxIt = 0;
for (int a = min(i, j); a <= max(i, j); a++) {
it = length(a);
if (it > maxIt) {
maxIt = it;
}
}
cout << i << ' ' << j << ' ' << maxIt << endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKaW50IGxlbmd0aChpbnQgY2gpIHsKICAgIGludCBpdCA9IDE7CiAgICB3aGlsZSAoY2ggIT0gMSkgewogICAgICAgIGlmIChjaCAlIDIgPT0gMSkgewogICAgICAgICAgICBjaCA9IGNoICogMyArIDE7CiAgICAgICAgfQogICAgICAgIGVsc2UgewogICAgICAgICAgICBjaCA9IGNoIC8gMjsKICAgICAgICB9CiAgICAgICAgaXQrKzsKICAgIH0KICAgIHJldHVybiBpdDsKfQoKaW50IG1haW4oKSB7CiAgICBpbnQgaSwgajsKICAgIHdoaWxlKGNpbiA+PiBpKSB7CiAgICAgICAgY2luID4+IGo7CiAgICAgICAgaW50IGl0LCBtYXhJdCA9IDA7CiAgICAgICAgZm9yIChpbnQgYSA9IG1pbihpLCBqKTsgYSA8PSBtYXgoaSwgaik7IGErKykgewogICAgICAgICAgICBpdCA9IGxlbmd0aChhKTsKICAgICAgICAgICAgaWYgKGl0ID4gbWF4SXQpIHsKICAgICAgICAgICAgICAgIG1heEl0ID0gaXQ7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgY291dCA8PCBpIDw8ICcgJyA8PCBqIDw8ICcgJyA8PCBtYXhJdCA8PCBlbmRsOwogICAgfQogICAgcmV0dXJuIDA7Cn0=