Zack is a professional gamer who loves to play challenging games. Recently, he has been playing a very difficult game called The Elden Program. In The Elden Program, there are $$$n$$$ monsters standing in a row, where each monster $$$i$$$ has an energy level of $$$a_i$$$.
Fortunately, Zack found a powerful spell that he can use against the monsters. This spell can be cast on a single monster. When he casts this spell on a monster $$$x$$$, monster $$$x$$$ becomes fixed in place, while every other monster will:
Keep in mind that when a monster vanishes, that doesn't mean they are defeated.
The rest of the monsters perform those actions in such a way to minimize the time it takes to defeat monster $$$x$$$.
Zack wants to plan out his assault on the monsters, so he asks you to determine the time it takes to defeat each monster if the spell was cast on it, or determine that it's impossible to defeat it.
The first line contains one integer $$$t \: (1 \le t \le 10^4)$$$ — the number of test cases.
The first line of each test case consists of a single integer $$$n$$$ $$$(1 \le n \le 3 \cdot 10^5)$$$ — the number of monsters.
The second line of each testcase consists of $$$n$$$ integers $$$(1 \le a_i \le 10^9)$$$ — denoting the energy of each monster.
It is guaranteed that the sum of $$$n$$$ over all test cases doesn't exceed $$$3 \cdot 10^5$$$.
For each testcase, output $$$n$$$ numbers, the time it takes to defeat monster $$$i$$$ if the spell was cast on it, or "-1" if it is impossible to defeat it.
6125 6 3 1 5 5 5 8 1 6 7 6125 6 3 1 5 5 5 8 1 6 1 5125 6 3 1 5 5 5 100 1 6 1 5125 6 3 1 5 5 5 8 1 6 7 651 1 1 1 1510 1 1 1 2
1 3 1 1 3 2 1 3 1 1 3 1 1 3 1 1 3 2 1 6 1 2 1 2 1 3 1 1 3 2 1 -1 1 2 1 2 1 3 1 1 3 2 1 3 1 1 3 1 -1 -1 -1 -1 -1 -1 1 2 1 4
Consider the second testcase. When you cast a spell on the $$$8$$$-th monster $$$a_8 = 8$$$, all the other monsters will work together to defeat it. The monsters on the right of the $$$8$$$-th monster will go to the right so they won't increase it's power. The 2-nd monster $$$a_2 = 6$$$ will go towards the $$$8$$$-th monster while the other monsters in between the two monsters will go into the $$$2$$$-nd monster increasing it's power.
| Название |
|---|


