#P1760C. Advantage

    ID: 573 Type: RemoteJudge 2000ms 256MiB Tried: 0 Accepted: 0 Difficulty: 3 Uploaded By: Tags>data structuresimplementationsortings*800

Advantage

Description

There are nn participants in a competition, participant ii having a strength of sis_i.

Every participant wonders how much of an advantage they have over the other best participant. In other words, each participant ii wants to know the difference between sis_i and sjs_j, where jj is the strongest participant in the competition, not counting ii (a difference can be negative).

So, they ask you for your help! For each ii (1in1 \leq i \leq n) output the difference between sis_i and the maximum strength of any participant other than participant ii.

The input consists of multiple test cases. The first line contains an integer tt (1t10001 \leq t \leq 1000) — the number of test cases. The descriptions of the test cases follow.

The first line of each test case contains an integer nn (2n21052 \leq n \leq 2\cdot10^5) — the length of the array.

The following line contains nn space-separated positive integers s1s_1, s2s_2, ..., sns_n (1si1091 \leq s_i \leq 10^9) — the strengths of the participants.

It is guaranteed that the sum of nn over all test cases does not exceed 21052\cdot10^5.

For each test case, output nn space-separated integers. For each ii (1in1 \leq i \leq n) output the difference between sis_i and the maximum strength of any other participant.

Input

The input consists of multiple test cases. The first line contains an integer tt (1t10001 \leq t \leq 1000) — the number of test cases. The descriptions of the test cases follow.

The first line of each test case contains an integer nn (2n21052 \leq n \leq 2\cdot10^5) — the length of the array.

The following line contains nn space-separated positive integers s1s_1, s2s_2, ..., sns_n (1si1091 \leq s_i \leq 10^9) — the strengths of the participants.

It is guaranteed that the sum of nn over all test cases does not exceed 21052\cdot10^5.

Output

For each test case, output nn space-separated integers. For each ii (1in1 \leq i \leq n) output the difference between sis_i and the maximum strength of any other participant.

Sample Input 1

5
4
4 7 3 5
2
1 2
5
1 2 3 4 5
3
4 9 4
4
4 4 4 4

Sample Output 1

-3 2 -4 -2 
-1 1 
-4 -3 -2 -1 1 
-5 5 -5 
0 0 0 0

Note

For the first test case:

  • The first participant has a strength of 44 and the largest strength of a participant different from the first one is 77, so the answer for the first participant is 47=34 - 7 = -3.
  • The second participant has a strength of 77 and the largest strength of a participant different from the second one is 55, so the answer for the second participant is 75=27 - 5 = 2.
  • The third participant has a strength of 33 and the largest strength of a participant different from the third one is 77, so the answer for the third participant is 37=43 - 7 = -4.
  • The fourth participant has a strength of 55 and the largest strength of a participant different from the fourth one is 77, so the answer for the fourth participant is 57=25 - 7 = -2.