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