let solve s _ =
  let non_one = String.map (fun c -> if c = '1' then ' ' else c) s in
  let trimmed = String.trim non_one in
  trimmed.[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 ()
;;