import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); HashMap map = new HashMap<>(); for(int i = 0; i < n; i++){ String s = sc.next(); int m = sc.nextInt(); map.put(s,m); } int c[] = new int[8]; for(int i = 0; i < 8; i++) c[i] = 0; for(int val : map.values()){ c[val] += 1; } for(int i = 0; i < 8; i++) System.out.println(c[i]); } }