fn main() { let stdin = std::io::read_to_string(std::io::stdin()).unwrap(); let mut stdin = stdin.split_ascii_whitespace(); let n: u32 = stdin.next().unwrap().parse().unwrap(); println!("{}", output(solve(n))); } fn solve(mut n: u32) -> (u32, u32) { let mut i = 0; let mut n_max = n; while n != 1 { match n & 1 { 0 => n >>= 1, 1 => n = n * 3 + 1, _ => unreachable!(), } n_max = n_max.max(n); i += 1; } (i, n_max) } fn output(ans: (u32, u32)) -> String { ans.0.to_string() + "\n" + &ans.1.to_string() }