#P1427. 小鱼的数字游戏

小鱼的数字游戏

Description

Xiao Yu was recently asked to take part in a number game: it needs to remember a sequence of numbers aia_i (with arbitrary length, ending with 00), then recite them in reverse order (do not recite the terminating 00). This is really too hard for Xiao Yu's limited memory—you know, its whole head isn't that big, and part of it is delicious meat! So please help Xiao Yu by writing a program to solve this problem.

Input Format

A single line containing a sequence of integers, ending with 00, separated by spaces.

Output Format

Output this sequence in reverse on a single line, separated by spaces.

3 65 23 5 34 1 30 0
30 1 34 5 23 65 3

Hint

Constraints

For 100%100\% of the testdata, it is guaranteed that 0ai23110 \leq a_i \leq 2^{31} - 1, and the number of integers does not exceed 100100.

Translated by ChatGPT 5