open Big_int

let make_list f t step =
  let rec make_list_inner c t lst =
    if c >= t then lst else make_list_inner (c+step) t (c::lst)
  in
  List.rev (make_list_inner f t [])

let () =
  let rec read acc =
    try let new_acc = (Scanf.scanf "%d\n" (fun x -> Big_int.add_big_int (Big_int.big_int_of_int x) acc)) in
        Printf.printf "%s\n" (Big_int.string_of_big_int new_acc);
        read new_acc
    with End_of_file ->
         ()
  in
  read Big_int.zero_big_int
;;