let () =
  let n = int_of_string (read_line()) in
  let string_numbers = Str.split (Str.regexp " ") (read_line()) in
  let reverse = List.rev string_numbers in
  let rec loop list i =
    match list with
    |[] -> ()
    |h::[] -> print_string h;
              print_string "\n";
              if i <> 1 then raise (Sys_error ": number of the numbers is wrong");
    |h::t -> print_string h;
             print_string " ";
             loop t (i-1)
  in
  loop reverse n
;;
