def recur(N, res, a=[]):
if N == 1:
res.append(a[:])
return
for op in (" ", "+", "-"):
a.append(op)
recur(N-1, res, a)
a.pop()
T = int(input())
for _ in range(T):
N = int(input())
a = list(range(1, N + 1))
res = []
recur(N, res)
for ops in res:
exp = ""
for i in range(N-1):
exp += str(a[i]) + ops[i]
exp += str(a[-1])
if eval(exp.replace(" ", "")) == 0:
print(exp)
print()