FJ gave Bessie an array a of length N (2≤N≤500,−1015≤a_i≤1015) with all 2N(N+1) contiguous subarray sums distinct. For each index i∈\[1,N], help Bessie compute the minimum amount it suffices to change a_i by so that there are two different contiguous subarrays of a with equal sum.
The first line contains N.
The next line contains a_1,…,a_N (the elements of a, in order).
One line for each index i∈\[1,N].