atcoder#ARC077A. [ABC066C] pushpush

[ABC066C] pushpush

Score : 300300 points

Problem Statement

You are given an integer sequence of length nn, a1,...,ana_1, ..., a_n. Let us consider performing the following nn operations on an empty sequence bb.

The ii-th operation is as follows:

  1. Append aia_i to the end of bb.
  2. Reverse the order of the elements in bb.

Find the sequence bb obtained after these nn operations.

Constraints

  • 1n2×1051 \leq n \leq 2\times 10^5
  • 0ai1090 \leq a_i \leq 10^9
  • nn and aia_i are integers.

Input

Input is given from Standard Input in the following format:

nn

a1a_1 a2a_2 ...... ana_n

Output

Print nn integers in a line with spaces in between. The ii-th integer should be bib_i.

4
1 2 3 4
4 2 1 3
  • After step 1 of the first operation, bb becomes: 11.
  • After step 2 of the first operation, bb becomes: 11.
  • After step 1 of the second operation, bb becomes: 1,21, 2.
  • After step 2 of the second operation, bb becomes: 2,12, 1.
  • After step 1 of the third operation, bb becomes: 2,1,32, 1, 3.
  • After step 2 of the third operation, bb becomes: 3,1,23, 1, 2.
  • After step 1 of the fourth operation, bb becomes: 3,1,2,43, 1, 2, 4.
  • After step 2 of the fourth operation, bb becomes: 4,2,1,34, 2, 1, 3.

Thus, the answer is 4 2 1 3.

3
1 2 3
3 1 2

As shown above in Sample Output 1, bb becomes 3,1,23, 1, 2 after step 2 of the third operation. Thus, the answer is 3 1 2.

1
1000000000
1000000000
6
0 6 7 6 7 0
0 6 6 0 7 7