Problem L
Kemija
Instead of paying attention in class, Luka is killing time
playing with numbers again. This time, he wrote
The teacher noticed this and took away the first piece of paper, with the original ring. This did not trouble Luka much because he knows he can use the other ring to reconstruct the original.
Write a program that solves Luka’s problem.
Input
The first line contains the integer
Each of the following lines contains an integer less than
The input will be such that a solution, although not necesarily unique, will always exist.
Output
Output the original ring on
Rotating the ring is not allowed. For example, the sum of the first three output numbers must be equal to the second number in the input ring.
Note: the solution need not be unique.
Sample Input 1 | Sample Output 1 |
---|---|
3 5 5 5 |
2 1 2 |
Sample Input 2 | Sample Output 2 |
---|---|
4 20 15 17 14 |
5 8 2 7 |
Sample Input 3 | Sample Output 3 |
---|---|
5 7 8 9 10 11 |
4 1 3 5 2 |