let rec a s n c = if n < 0 then c else a s (n - 1) ((fun x -> if x = '1' then c else x) (String.get s n))
let _ = Printf.printf "%c" (Scanf.scanf "%s %d" (fun x y -> a x (min (String.length x) y - 1) '1'))