Reverse an Array
Read an integer N, then read N integers. Print them in reverse order, separated by spaces.
Input
- First line: an integer
N(1 <= N <= 2·10^4) - The next
Nlines: one integer per line (-10^9 <= x <= 10^9)
Output
The N integers in reverse order, space-separated, on one line.
Examples
Input:
5
1
2
3
4
5
Output: 5 4 3 2 1
Input:
3
10
20
30
Output: 30 20 10
Input:
1
9
Output: 9
Reversing a single-element array leaves it unchanged.