import java.util.*; import java.io.PrintWriter; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); PrintWriter pw = new PrintWriter(System.out); 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())]++; } for (int i = 1; i <= M; i++) { pw.println(i + " " + cnt[i]); } pw.flush(); } }