K. Sadism
time limit per test
2 seconds
memory limit per test
1024 megabytes
input
standard input
output
standard output
Examples
Input
4
1 0 0 2
Output
2 5 2 1 0
Input
7
1 5 4 2 6 0 3
Output
16 10 0 1 0 0 0 1