import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int N = sc.nextInt(); int M = sc.nextInt(); int[] cnt = new int[200001]; for (int i = 0; i < N; i++) { cnt[Integer.parseInt(sc.next())]++; } StringBuilder sb = new StringBuilder(); for (int i = 1; i <= M; i++) { sb.append(i + " " + cnt[i] + '\n'); } System.out.print(sb); } }