import java.io.*;
import java.util.*;

/**
* ACM Problem #100 (3n+1 Problem)
*
* @author Felix Dietrich
* @version 1.0, 25/07/09
*
* Status : Accepted
*/

class Main
{

static BufferedReader reader;
static BufferedReader outputReader;
static boolean useTestData = false;
static String testData = "test.txt";

public static void main(String args[]) throws IOException
{
String input;

if (useTestData)
{
reader = new BufferedReader(new FileReader(testData));
// outputReader = new BufferedReader(new FileReader("output.txt"));
} else
reader = new BufferedReader(new InputStreamReader(System.in));

while ((input = reader.readLine()) != null)
{
work(input.trim()); // the true entry point
}
}

private static void work(String input)
{
if(input.length() < 3)
return;

StringTokenizer st = new StringTokenizer(input);

int s1 = Integer.parseInt(st.nextToken());
int s2 = Integer.parseInt(st.nextToken());
int min = s1;
int max = s2;
int n = 0;
int current;

if(s1 > s2)
{
min = s2;
max = s1;
}

for(int i=min; i<=max; i++)
{
current = cycle(i);
if(n == 0 || n < current)
n = current;
}

System.out.println(s1 + " " + s2 + " " + n);
}

private static int cycle(int parseInt)
{
int count = 1;
while(parseInt > 1)
{
if((parseInt & 1) == 0)
parseInt>>=1;
else
parseInt = parseInt*3+1;
count++;
}
return count;
}

}