
let rev_split str delim =
  let rec doit s acc =
    match
      try Some (String.index s delim)
      with _ -> None
    with
    | None -> s :: acc
    | Some i ->
        let s1 = String.sub s 0 i in
        let s2 = String.sub s (i + 1) (String.length s - String.length s1 - 1) in
        doit s2 (s1 :: acc)
  in
  doit str []

let take n lst =
  let rec doit n lst acc =
    if n <= 0 then List.rev acc
    else
      match lst with
      | [] -> List.rev acc
      | hd :: tl -> doit (n - 1) tl (hd :: acc)
  in
  doit n lst []

let () =
  let n = read_int () in
  let l = read_line () in
  let ss = take n (rev_split l ' ') in
  List.iteri (fun i s ->
    if i = 0 then Printf.printf "%s" s
    else Printf.printf " %s" s)
    ss;
  print_newline ()