#include #include #include #include #include #include #include #include #include #include #include #include typedef long long ll; using namespace std; #define mod 1000000007 #define INF 1000000000 #define LLINF 2000000000000000000LL #define PI 3.1415926536 #define SIZE 1000002 int n,d; string s; vector df(vector vec){ for(int i=1;i dfs(int l,int r){ vector ret(11,0); for(int i=l;i<=r;){ int cc=0,k=1; bool f = false; if(s[i]=='d'){ cc=0; for(int j=i;;j++){ if(s[j]=='{') cc++; if(s[j]=='}'){ cc--; if(cc>0) continue; vector d =dfs(i+2,j-1); d = df(d); for(int m=0;m> n >> d >> s; vector ans = dfs(0,(int)s.size()-1); for(int i=0;i<=d;i++){ printf(i!=d? "%d ":"%d\n",ans[i]); } return 0; }