P6340 [COCI 2007/2008 #2] KEMIJA
Description
Please construct a ring made up of $n$ numbers, such that for every number in the ring, the result of adding it with its two adjacent numbers is equal to the given target ring.
Input Format
The first line contains an integer $n$.
The next $n$ lines each contain an integer, representing the given target ring.
Output Format
Output $n$ lines in total, each containing one integer, describing the ring you construct.
**There may be multiple valid constructions. This problem uses SPJ.**
Explanation/Hint
#### Constraints
- For $70\%$ of the testdata, it is guaranteed that $n < 100$.
- For $100\%$ of the testdata, it is guaranteed that $3 \le n \le 10^4$, and the numbers in the given target ring do not exceed $10^9$.
#### Notes
**Translated from [COCI2007-2008](https://hsin.hr/coci/archive/2007_2008/) [CONTEST #2](https://hsin.hr/coci/archive/2007_2008/contest2_tasks.pdf) *T5 KEMIJA***。
Translated by ChatGPT 5