#include #include #include #include using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); vector c(8, 0); map mp; int N; cin >> N; for (int i = 0; i < N; i++) { string S; int C; cin >> S >> C; mp[S] = C; } for (auto &[S, C]: mp) c[C]++; for (int t: c) cout << t << endl; return 0; }