Write a program that reverse a list of numbers

The program should call a function that takes an array and reverse it in-place.

Requirements

Input

The program takes the number list from the standard input.
The format of the input is:

  • line #1 contains the size of the list.
  • line #2 contains space-separated integer number.

Output

The program should display the modified list. The format list should be space-separated numbers

Samples

Sample #1

$ reverse
5
1 2 3 4 5
5 4 3 2 1

Sample #2

$ reverse
8
1 2 3 4 5 6 7 8
8 7 6 5 4 3 2 1

Solutions

Python3