use std::io::*;fn main(){let s=stdin();for l in s.lock().lines(){print!("1{}4{0}6{0}4{0}1 ",l.unwrap().replace("1",""))}}