let fix c = if c='1' then '9' else (if c='9' then '1' else c);;
let f a b c = List.map fix [a;b;c] |> List.map (String.make 1) |> String.concat "";;
let () = Scanf.scanf "%c%c%c" f
|> Printf.printf "%s\n"