Skip to content
C

Reverse a Stack

Easyjavapythonccppjavascript

Given a stack of integers described from bottom to top, print the stack contents after reversing it, again from bottom to top.

Input Format

The first line contains an integer N. The second line contains N space-separated integers, the stack from bottom to top.

Output Format

Print the reversed stack from bottom to top, separated by single spaces.

Input (stdin)

Output

Run your code to see output here...