#include <bits/stdc++.h>
using namespace std;
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
string s;
if(!(cin>>n>>s)) return 0;
int A=0,B=0,C=0;
for(char c:s){ if(c=='+') A++; else if(c=='0') B++; else C++; }
if(B==1){ cout<<-1<<"\n"; return 0; }
const int N=55;
vector<vector<vector<string>>> dp(A+1, vector<vector<string>>(B+1, vector<string>(C+1, "")));
dp[0][0][0] = "";
for(int sum=0; sum<n; ++sum){
for(int j=min(sum,A); j>=0; --j){
for(int t=min(sum-j,B); t>=0; --t){
int k = sum - j - t;
if(k<0 || k> C) continue;
string cur = dp[j][t][k];
if(cur=="") continue;
int used = j+t+k;
if(used != sum) continue;
if((used%2==0) && j+1<=A){
string &to = dp[j+1][t][k];
string cand = cur + '+';
if(to=="" || cand < to) to = cand;
}
if((used%2==1) && k+1<=C){
string &to = dp[j][t][k+1];
string cand = cur + '-';
if(to=="" || cand < to) to = cand;
}
for(int p=2; p<=B - t; ++p){
string &to = dp[j][t+p][k];
string cand = cur + string(p,'0');
if(to=="" || cand < to) to = cand;
}
}
}
}
string best = dp[A][B][C];
if(best==""){ cout<<-1<<"\n"; return 0; }
vector<int> posPlus, posZero, posMinus;
for(int i=0;i<n;i++){
if(s[i]=='+') posPlus.push_back(i);
else if(s[i]=='0') posZero.push_back(i);
else posMinus.push_back(i);
}
vector<int> idxPlus( posPlus.size() ), idxZero(posZero.size()), idxMinus(posMinus.size());
iota(idxPlus.begin(), idxPlus.end(), 0);
iota(idxZero.begin(), idxZero.end(), 0);
iota(idxMinus.begin(), idxMinus.end(), 0);
vector<int> a(n,0);
int pP=0,pZ=0,pM=0;
int curVal=1;
for(size_t i=0;i<best.size();){
char c = best[i];
if(c=='+' || c=='-'){
int chosen=-1;
if(c=='+'){ chosen = posPlus[pP++]; }
else { chosen = posMinus[pM++]; }
a[chosen]=curVal++;
i++;
} else {
int j=i;
while(j<best.size() && best[j]=='0') j++;
int block = j - i;
vector<int> chosenIdx;
for(int t=0;t<block;t++){
chosenIdx.push_back(posZero[pZ++]);
}
sort(chosenIdx.begin(), chosenIdx.end());
for(int x: chosenIdx) a[x]=curVal;
curVal++;
i = j;
}
}
for(int i=0;i<n;i++){
if(i) cout<<' ';
cout<<a[i];
}
cout<<"\n";
return 0;
}