import java.util.*; import java.io.PrintWriter; 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.print(sb); PrintWriter pw = new PrintWriter(System.out); for (int i = 1; i <= M; i++) { pw.println(i + " " + m.getOrDefault(i, 0)); } pw.flush(); } }