#include using namespace std; int main() { int64_t N; cin >> N; constexpr int64_t M = 8; map mp; for (int64_t i = 0; i < N; i++) { string S; int64_t C; cin >> S >> C; mp[S] = C; } vector num(M, 0); for (const auto [name, c] : mp) { num[c]++; } for (int64_t i = 0; i < M; i++) { cout << num[i] << endl; } }