#include using namespace std; using ll = long long; using Graph = vector>; int main() { int N; cin >> N; map dic; vector A(8,0); for(int i = 0; i < N; i++) { string S; cin >> S; int a; cin >> a; dic[S] = a; } for (const auto& [key, value] : dic) { A[value]++; } for(int i = 0; i < 8; i++) { cout << A[i] << endl; } }