Reversal with stack

Use stacks to reverse sequences of natural numbers.

Input

Input consists of various sequences of natural numbers ended with -1.

Output

For each input sequence, your program must print a line with the numbers
in reverse order separated by space.

Problem information

Author: Unknown
Translator: Carlos Molina

Generation: 2026-01-25T11:17:04.184Z

© Jutge.org, 2006–2026.
https://jutge.org
