T=int(input()) for _ in range(T): S=input() ans=[] sign="+" i=0 while i