PHƯỚC HƯNG OJ · THỬ THÁCH THUẬT TOÁN

#CCBCHBAHAI0000070. Đảo mảng bằng mảng phụ (Reverse an Array with an Auxiliary Array)

HỌC THEO LỘ TRÌNH

Bài tập thuộc lộ trình

1 lộ trình

Đảo mảng bằng mảng phụ (Reverse an Array with an Auxiliary Array)

Reverse an Array with an Auxiliary Array (Đảo mảng bằng mảng phụ)

Source: Problem Solving and Program Design in C

Version: Phuoc Hung OJ Extended

Problem

Given a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1}, create an auxiliary array bb of the same length such that

bi=an−1−i(0≤i<n).b_i=a_{n-1-i}\qquad(0\le i<n).

The source array aa must not be modified while constructing bb. Print bb.

Input

The first line contains nn. The second line contains nn integers aia_i.

Output

Print b0,b1,…,bn−1b_0,b_1,\ldots,b_{n-1} on one line.

Subtask

Subtask 1 (20 points): 1≤n≤101\le n\le10, ∣ai∣≤103|a_i|\le10^3.

Subtask 2 (30 points): 1≤n≤50001\le n\le5000, ∣ai∣≤106|a_i|\le10^6.

Subtask 3 (50 points): 1≤n≤2⋅1051\le n\le2\cdot10^5, ∣ai∣≤109|a_i|\le10^9.

Example

Input

6
4 -2 7 7 0 9

Output

9 0 7 7 -2 4

Explanation

The sample follows the mathematical definition above.