Codeforces Round 370 (Div. 2) |
---|

Finished |

Virtual contest is a way to take part in past contest, as close as possible to participation on time. It is supported only ICPC mode for virtual contests.
If you've seen these problems, a virtual contest is not for you - solve these problems in the archive.
If you just want to solve some problem from a contest, a virtual contest is not for you - solve this problem in the archive.
Never use someone else's code, read the tutorials or communicate with other person during a virtual contest.

implementation

math

*800

No tag edit access

The problem statement has recently been changed. View the changes.

×
A. Memory and Crow

time limit per test

2 secondsmemory limit per test

256 megabytesinput

standard inputoutput

standard outputThere are *n* integers *b*_{1}, *b*_{2}, ..., *b*_{n} written in a row. For all *i* from 1 to *n*, values *a*_{i} are defined by the crows performing the following procedure:

- The crow sets
*a*_{i}initially 0. - The crow then adds
*b*_{i}to*a*_{i}, subtracts*b*_{i + 1}, adds the*b*_{i + 2}number, and so on until the*n*'th number. Thus,*a*_{i}=*b*_{i}-*b*_{i + 1}+*b*_{i + 2}-*b*_{i + 3}....

Memory gives you the values *a*_{1}, *a*_{2}, ..., *a*_{n}, and he now wants you to find the initial numbers *b*_{1}, *b*_{2}, ..., *b*_{n} written in the row? Can you do it?

Input

The first line of the input contains a single integer *n* (2 ≤ *n* ≤ 100 000) — the number of integers written in the row.

The next line contains *n*, the *i*'th of which is *a*_{i} ( - 10^{9} ≤ *a*_{i} ≤ 10^{9}) — the value of the *i*'th number.

Output

Print *n* integers corresponding to the sequence *b*_{1}, *b*_{2}, ..., *b*_{n}. It's guaranteed that the answer is unique and fits in 32-bit integer type.

Examples

Input

5

6 -4 8 -2 3

Output

2 4 6 1 3

Input

5

3 -2 -1 5 6

Output

1 -3 4 11 6

Note

In the first sample test, the crows report the numbers 6, - 4, 8, - 2, and 3 when he starts at indices 1, 2, 3, 4 and 5 respectively. It is easy to check that the sequence 2 4 6 1 3 satisfies the reports. For example, 6 = 2 - 4 + 6 - 1 + 3, and - 4 = 4 - 6 + 1 - 3.

In the second sample test, the sequence 1, - 3, 4, 11, 6 satisfies the reports. For example, 5 = 11 - 6 and 6 = 6.

Codeforces (c) Copyright 2010-2024 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/25/2024 18:32:59 (l3).

Desktop version, switch to mobile version.

Supported by

User lists

Name |
---|