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(); Map m = new HashMap<>(); for (int i = 0; i < N; i++) { m.merge(Integer.parseInt(sc.next()), 1, Integer::sum); } StringBuilder sb = new StringBuilder(); for (int i = 1; i <= M; i++) { sb.append(i + " " + m.getOrDefault(i, 0) + '\n'); } System.out.println(sb); } }