#include using namespace std; int main() { int N; cin >> N; string S; cin >> S; vector data(N,0); int pos = 0; for (auto c : S) { if (c == '+') { data[pos]++; } if (c == '-') { data[pos]--; } if (c == '>') { pos++; if (pos >= N) { cout << "error" << endl; return 0; } } if (c == '<') { pos--; if (pos < 0) { cout << "error" << endl; return 0; } } } for (int i = 0; i < N; i++) { cout << data[i] << " "; } cout << endl; }