Scanf.scanf "%c%c%c" (fun a b c ->
    Printf.printf "%c%c%c\n"
        (if a = '1' then '9' else if a = '9' then '1' else a)
        (if b = '1' then '9' else if b = '9' then '1' else b)
        (if c = '1' then '9' else if c = '9' then '1' else c)
)