N=int(input()) dat=[0]*N p=0 for c in input(): if c=="+": dat[p]+=1 elif c=="-": dat[p]-=1 elif c==">": p+=1 else: p-=1 if p not in range(N): print("error") break else: print(*dat)