#define _USE_MATH_DEFINES #include #include #include #include #include #include //#include #include #include #include #include #include #include ///////// #define REP(i, x, n) for(int i = x; i < n; i++) #define rep(i,n) REP(i,0,n) #define P(p) cout<<(p)< ///////// typedef long long LL; typedef long double LD; ///////// using namespace::std; ///////// int X[11];//次数係数 vector bbb(string s,int n){ vector ans(12),temp(12); rep(i,12){ ans[i]=0; temp[i]=0; } int ter=0,X=0; for(int i = n;i0){ if( ter == 0){ ans[X] += 1; }else{ ans[X] += ter; ter = 0; } X = 0; }else{ ans[0] += ter; } ter = 0; }else if( s[i] == 'x'){ ++X; }else if( s[i] == '*'){ }else if( s[i] == '{'){ }else if( s[i] == '}'){ if(X>0){ if( ter == 0){ ans[X] += 1; }else{ ans[X] += ter; ter = 0; } X = 0; }else{ ans[0] += ter; } ter = 0; for(int j= 0;j<=10;++j){ ans[j] = (j+1)*ans[j+1]; } ans[11] = i; return ans; }else{ ter = s[i] - '0'; } } if(X>0){ if( ter == 0){ ans[X] += 1; }else{ ans[X] += ter; ter = 0; } X = 0; }else{ ans[0] += ter; } ter = 0; return ans; } void solce(string s){ //+*[19] } int main(void){ std::cin.tie(0); std::ios::sync_with_stdio(false); std::cout << std::fixed;// //cout << setprecision(16);// int N,d; string s; cin>>N>>d>>s; vector ans(12); ans = bbb(s,0); for(int i=0;i<=d;++i){ cout << ans[i]; if(i != d){ cout << " "; }else{ cout << endl; } } return 0; }