#include #include using namespace std; int N; int A[10]; string S; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cin>>N>>S; int pt=0; for(char c:S) { if(c=='>')pt++; else if(c=='<')pt--; else if(c=='+')A[pt]++; else A[pt]--; if(pt<0||pt>=N) { cout<<"error\n"; return 0; } } for(int i=0;i