use std::{collections::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 e = HashSet::new();
	let mut a = [0u32; 8];
	for r in i.iter().rev() {
		let mut r = r.split_whitespace();
		let s = r.next().unwrap();
		let c: usize = r.next().unwrap().parse().unwrap();
		if !e.contains(s) {
			e.insert(s);
			a[c] += 1;
		}
	}
	a.iter().for_each(|i| println!("{}", i));
}