let s = read_line () in
let s = Str.global_replace (Str.regexp "1") "a" s in
let s = Str.global_replace (Str.regexp "9") "1" s in
let s = Str.global_replace (Str.regexp "a") "9" s in
Printf.printf "%s\n" s

