fn getline() -> String { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s.trim().to_string() } fn number_to_string(n: u64, radix: u64) -> String { let mut rv = Vec::new(); let mut m = n; while radix <= m { let r = m % radix; rv.push(r.to_string()); m = m / radix; } rv.push(m.to_string()); rv.reverse(); rv.concat() } fn main() { let s = getline(); let n: u64 = s.trim().parse().unwrap(); println!("{}", number_to_string(n, 7)); }