N = int(input()) S = input() ans = [0]*N idx = 0 for s in S: if s == "+": ans[idx] += 1 elif s == "-": ans[idx] -= 1 elif s == ">": idx += 1 else: idx -= 1 if not 0 <= idx < N: print("error") break else: print(*ans)