use std::{
	collections::{HashMap, HashSet},
	io::Read,
};

fn main() {
	let mut s = String::new();
	std::io::stdin().read_to_string(&mut s).ok();
	let i: Vec<_> = s.trim().split('\n').skip(1).collect();
	let mut set = HashSet::new();
	let mut m: HashMap<_, u32> = HashMap::new();
	for r in i.iter().rev() {
		let mut r = r.split_whitespace();
		let s = r.next().unwrap();
		let c: u8 = r.next().unwrap().parse().unwrap();
		if !set.contains(s) {
			set.insert(s);
			*m.entry(c).or_default() += 1;
		}
	}
	(0..8).for_each(|i| println!("{}", m.entry(i).or_default()));
}