#P1326B. Maximums

Maximums

No submission language available for this problem.

Description

Alicia has an array, a1,a2,,ana_1, a_2, \ldots, a_n, of non-negative integers. For each 1in1 \leq i \leq n, she has found a non-negative integer xi=max(0,a1,,ai1)x_i = max(0, a_1, \ldots, a_{i-1}). Note that for i=1i=1, xi=0x_i = 0.

For example, if Alicia had the array a={0,1,2,0,3}a = \{0, 1, 2, 0, 3\}, then x={0,0,1,2,2}x = \{0, 0, 1, 2, 2\}.

Then, she calculated an array, b1,b2,,bnb_1, b_2, \ldots, b_n: bi=aixib_i = a_i - x_i.

For example, if Alicia had the array a={0,1,2,0,3}a = \{0, 1, 2, 0, 3\}, b={00,10,21,02,32}={0,1,1,2,1}b = \{0-0, 1-0, 2-1, 0-2, 3-2\} = \{0, 1, 1, -2, 1\}.

Alicia gives you the values b1,b2,,bnb_1, b_2, \ldots, b_n and asks you to restore the values a1,a2,,ana_1, a_2, \ldots, a_n. Can you help her solve the problem?

The first line contains one integer nn (3n2000003 \leq n \leq 200\,000) – the number of elements in Alicia's array.

The next line contains nn integers, b1,b2,,bnb_1, b_2, \ldots, b_n (109bi109-10^9 \leq b_i \leq 10^9).

It is guaranteed that for the given array bb there is a solution a1,a2,,ana_1, a_2, \ldots, a_n, for all elements of which the following is true: 0ai1090 \leq a_i \leq 10^9.

Print nn integers, a1,a2,,ana_1, a_2, \ldots, a_n (0ai1090 \leq a_i \leq 10^9), such that if you calculate xx according to the statement, b1b_1 will be equal to a1x1a_1 - x_1, b2b_2 will be equal to a2x2a_2 - x_2, ..., and bnb_n will be equal to anxna_n - x_n.

It is guaranteed that there exists at least one solution for the given tests. It can be shown that the solution is unique.

Input

The first line contains one integer nn (3n2000003 \leq n \leq 200\,000) – the number of elements in Alicia's array.

The next line contains nn integers, b1,b2,,bnb_1, b_2, \ldots, b_n (109bi109-10^9 \leq b_i \leq 10^9).

It is guaranteed that for the given array bb there is a solution a1,a2,,ana_1, a_2, \ldots, a_n, for all elements of which the following is true: 0ai1090 \leq a_i \leq 10^9.

Output

Print nn integers, a1,a2,,ana_1, a_2, \ldots, a_n (0ai1090 \leq a_i \leq 10^9), such that if you calculate xx according to the statement, b1b_1 will be equal to a1x1a_1 - x_1, b2b_2 will be equal to a2x2a_2 - x_2, ..., and bnb_n will be equal to anxna_n - x_n.

It is guaranteed that there exists at least one solution for the given tests. It can be shown that the solution is unique.

Samples

Sample Input 1

5
0 1 1 -2 1

Sample Output 1

0 1 2 0 3

Sample Input 2

3
1000 999999000 -1000000000

Sample Output 2

1000 1000000000 0

Sample Input 3

5
2 1 2 2 3

Sample Output 3

2 3 5 7 10

Note

The first test was described in the problem statement.

In the second test, if Alicia had an array a={1000,1000000000,0}a = \{1000, 1000000000, 0\}, then x={0,1000,1000000000}x = \{0, 1000, 1000000000\} and b={10000,10000000001000,01000000000}={1000,999999000,1000000000}b = \{1000-0, 1000000000-1000, 0-1000000000\} = \{1000, 999999000, -1000000000\}.