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