#load "str.cma"
open Scanf
open Printf

let rec print_list a_list =
  match a_list with
    [] -> ()
  | fst::[] -> printf "%d" fst;print_newline()
  | fst::rest -> printf "%d " fst;print_list rest;;

let () =
  let s1 = read_line() in
  let s2 = read_line() in
  let list_of_ints = List.map int_of_string (Str.split (Str.regexp " ") s2) in
  print_list @@ List.rev @@ list_of_ints;;