let () =
  Scanf.scanf "%1d%1d%1d\n"
    (fun a b c ->
       if a = 1 then if b = 1 then if c = 1 then 999 else 991
         else if c = 1 then 919 else 911
       else if b = 1 then if c = 1 then 199 else 191
       else if c = 1 then 119 else 111
    )
  |> print_int
