use std::collections::HashMap; fn main() { let mut n = String::new(); std::io::stdin().read_line(&mut n).ok(); let n: usize = n.trim().parse().unwrap(); let mut cnts = vec![0usize; 8]; let mut mapping = HashMap::new(); for _ in 0..n { let mut temp = String::new(); std::io::stdin().read_line(&mut temp).ok(); let temp: Vec<&str> = temp.trim().split_whitespace().collect::>(); mapping.insert(temp[0].to_string(), temp[1].parse::().unwrap()); } for &c in mapping.values() { cnts[c] += 1; } for &v in cnts.iter() { println!("{}", v); } }