#![allow(clippy::let_unit_value)] #![allow(non_snake_case)] use std::{collections::HashMap, io::stdin, iter::zip}; fn main() { let mut buf = String::new(); stdin().read_line(&mut buf).ok(); let N = buf.trim().parse().ok().unwrap(); let mut C = Vec::new(); let mut S = Vec::new(); let mut color: HashMap = HashMap::new(); for i in 0..N { let mut buf = String::new(); stdin().read_line(&mut buf).unwrap(); let mut iter = buf.split_whitespace(); let s = iter.next().unwrap().to_string(); let c = iter.next().unwrap().parse::().unwrap(); S.push(s); C.push(c); } for (s, c) in zip(S, C) { color.insert(s, c); } let mut ans = vec![0_i32; 8]; for (key, value) in color.iter() { ans[*value] += 1; } for a in ans { println!("{}", a); } }