let () = Scanf.scanf "%s\n%d\n" @@ fun s _ ->
  Printf.printf "%c\n" @@
    try
      List.find (( <> ) '1') @@
        Array.to_list @@
          Array.init (String.length s) (String.get s)
    with Not_found -> '1'
