A permutation of length N is an array of N integers such that every integer from 1 to N appears exactly once. For example, [2,3,5,4,1] is a permutation of length 5, while [1,2,2],[4,5,1,3] are not permutations.
For a given array B of length N+1, the difference array is an array A of length N such that Ai=Bi+1−Bi for each 1≤i≤N. For example, the difference array of the array [3,7,5,1,4] is [4,−2,−4,3].
Alice gives you an array A of length N. Find a permutation P of length (N+1) such that the difference array of the permutation P and the given array A are equal. Print −1 if no such permutation exists.
Input format
Output format
For each test case, print −1 if no suitable permutation exists or print N+1 space-separated integer denoting the elements of the permutation.
Constraints
1≤T≤1051≤N≤3⋅105−N≤Ai≤NSum of N over all test cases does not exceed 3⋅105.
In the first test case, the difference array of the permutation [3,5,1,4,2] is [2,−4,3,−2] which is equal to the array A.
In the second test case, there is no permutation of length 4 for which the difference array is equal to the array A.