fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let mut n: u32 = n.trim().parse().unwrap(); if n == 0 { println!("0"); } else { let mut digits = vec![]; while n > 0 { digits.push(n % 7); n /= 7; } digits.reverse(); let answer: String = digits .iter() .map(|&n| char::from_digit(n, 10).unwrap()) .collect(); println!("{}", answer); } }