fn input_num() -> usize { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().parse().unwrap() } fn input_chars() -> Vec { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.trim().chars().collect() } fn input_nums() -> (usize, usize, usize) { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); let mut iter = line.split_whitespace(); ( iter.next().unwrap().parse().unwrap(), iter.next().unwrap().parse().unwrap(), iter.next().unwrap().parse().unwrap() ) } fn input_vec_nums() -> Vec { let mut line: String = String::new(); std::io::stdin().read_line(&mut line).unwrap(); line.split_whitespace() .map(|x| x.parse().unwrap()) .collect() } fn main() { let mut s = input_chars(); let n = s.len(); for i in 0..n { print!("{}{}", if i == n-1 {if s[i] == '1' {'0'} else {'1'}} else {s[i]}, if i == n-1 {"\n"} else {""}); } }