All tasks
Easyarraystwo-pointers

Reverse an Array

Time limit 2 s · Memory 64 MB

Statement

The first line contains n, the second line contains n integers. Print them in reverse order on one line separated by spaces.

Constraints

1 ≤ n ≤ 10^5 -10^9 ≤ a_i ≤ 10^9

Examples

Input 1
5
1 2 3 4 5
Output 1
5 4 3 2 1
Input 2
4
-1 0 1 2
Output 2
2 1 0 -1
Solve this task to unlock the editorial.

AI tutor

Stuck? Get a nudge — the tutor explains the idea, it never hands you the solution.