CF1774A.Add Plus Minus Sign

传统题 时间 2000 ms 内存 256 MiB 3 尝试 1 已通过 1 标签

Add Plus Minus Sign

AquaMoon has a string aa consisting of only 00 and 11. She wants to add ++ and - between all pairs of consecutive positions to make the absolute value of the resulting expression as small as possible. Can you help her?

Input

The first line contains a single integer tt (1t20001 \leq t \leq 2\,000)  – the number of test cases. The description of test cases follows.

The first line of each test case contains a single integer nn (2n1002 \leq n \leq 100) — the length of aa.

The second line of each test case contains a string aa of length nn, consisting of only 00 and 11.

Output

For each test case, output a string of length n1n - 1 consisting of - and ++ on a separate line. If there is more than one assignment of signs that produces the smallest possible absolute value, any of them is accepted.

Note

In the first test case, we can get the expression 11=01 - 1 = 0, with absolute value 00.

In the second test case, we can get the expression 0+11+0+1=10 + 1 - 1 + 0 + 1 = 1, with absolute value 11.

In the third test case, we can get the expression 1+0+0+01=01 + 0 + 0 + 0 - 1 = 0, with absolute value 00.

Samples

3
2
11
5
01101
5
10001
-
+-++
+++-

在线编程 IDE

建议全屏模式获得最佳体验