#include using namespace std; using ll = long long; #define rep(i,m,n) for(int i=m; i> N; vector S(N); vector C(N); rep(i, 0, N) cin >> S[i] >> C[i]; set used; vector ans(8,0); for(int i = N-1; i >= 0; --i){ auto itr = used.find(S[i]); if(itr != used.end()) continue; ans[C[i]]++; used.insert(S[i]); } for(int &a : ans) cout << a << endl; return 0; }