#CCBCHBAHAI0000069. Tổng từng cặp đối xứng (Sums of Symmetric Pairs)

    ID: 987 Loại: Thông thường 2000ms 256MiB Tried: 0 Đã chấp nhận: 0 Độ khó: 1 Đăng bởi: Nhãn>Programming language basicsStatic arraysIteration techniquesImplementation techniquesInteger arithmetic

Tổng từng cặp đối xứng (Sums of Symmetric Pairs)

Sums of Symmetric Pairs (Tổng từng cặp đối xứng)

Source: Phước Hưng OJ

Version: Phuoc Hung OJ Extended

Problem

Given a0,a1,…,an−1a_0,a_1,\ldots,a_{n-1}, let

k=⌊n2⌋.k=\left\lfloor\frac n2\right\rfloor.

For every 0≤i<k0\le i<k, define

bi=ai+an−1−i.b_i=a_i+a_{n-1-i}.

If nn is odd, keep the unpaired middle element unchanged:

bk=ak.b_k=a_k.

Thus the result length is m=⌈n/2⌉m=\lceil n/2\rceil. Print b0,…,bm−1b_0,\ldots,b_{m-1}.

Input

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

Output

Print the m=⌈n/2⌉m=\lceil n/2\rceil integers of bb 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

7
2 5 -1 8 4 9 3

Output

5 14 3 8

Explanation

The sample follows the mathematical definition above.