408165: GYM103036 A Switching Up the Playlist

Memory Limit:256 MB Time Limit:1 S
Judge Style:Text Compare Creator:
Submit:0 Solved:0

Description

A. Switching Up the Playlisttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard output

Recently Joanna has become tired of listening to the music in her playlist in the same order over and over again. She still really enjoys the contest of the playlist, but wants to try listening to it in a different order to try to switch things up. Specifically, she wants to try reversing the playlist so that the last song plays first, the second to last song plays second, and so on.

Given Joanna's playlist, can you write a program to reverse the playlist so that she can listen to music in the new ordering?

Input

The first line of the input will consist of a single integer $$$n (3 \leq n \leq 100)$$$ which gives the number of songs on Joanna's playlist. The next $$$n$$$ lines each contain a string $$$s_i (5 \leq |s_i| \leq 20)$$$ made up of only lowercase and uppercase letters giving the name of the $$$i$$$th song on Joanna's playlist.

Output

Output Joanna's playlist in reverse order, with a single song per line.

ExampleInput
3
BohemianRhapsody
HookedOnAFeeling
CountryRoads
Output
CountryRoads
HookedOnAFeeling
BohemianRhapsody

加入题单

算法标签: