Scanf.scanf "%d" (fun n -> let rec loop i acc = if i = n then acc else let acc = Scanf.scanf " %s" (fun s -> acc ^ s) in loop (i + 1) acc in loop 0 "" |> print_endline )