#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; int main(){ int N; cin >> N; vector S(N); vector C(N), cnt(8); set st; for (int i=0; i> S[i] >> C[i]; for (int i=N-1; i>=0; i--){ if (st.count(S[i])) continue; st.insert(S[i]); cnt[C[i]]++; } for (int i=0; i<=7; i++) cout << cnt[i] << endl; return 0; }