use std::io; fn get_line() -> String { let mut input = String::new(); io::stdin().read_line(&mut input).unwrap(); input } fn main() { let input = get_line(); let ret:Vec<(u32, u32)> = input.trim().chars().map(|x| { let a = x.to_digit(10).unwrap(); (a / 2, a / 2 + (a % 2)) }).collect(); let mut res_1 = String::with_capacity(16); let mut res_2 = String::with_capacity(16); for (i, j) in ret { res_1 = res_1 + &i.to_string(); res_2 = res_2 + &j.to_string(); } println!("{} {}", res_1.trim_left_matches('0'), res_2.trim_left_matches('0')); }