let () = Scanf.scanf "%s %d"  (fun s k ->
   	let string_to_list = Str.split (Str.regexp "") s in
    let rec print_k k sl =
    if k <= 0
    then
    match sl with
    | [] ->  print_int 0
    | x :: xs -> print_int (int_of_string x)
    else
    match sl with
    | [] -> print_int 0
    | x :: xs -> print_k (k - (int_of_string x)) xs
    in
 print_k k string_to_list)
 
 (* Fatal error: exception Failure("int_of_string")
 になる。なんでだろう。
 *)