let solve s _ =
  let non_char_list = String.split_on_char '1' s in
  let filtered = List.filter (fun elem -> String.length elem > 0) non_char_list in
  (List.hd filtered).[0]

let () =
  let rec read () =
    try let ans = (Scanf.scanf "%s\n%s\n" solve) in
        Printf.printf "%c\n" ans
    with End_of_file -> ()
  in
  read ()
;;
