N, M = map(int, input().split()) l = list(map(int, input().split())) ans = [0 for i in range(M)] for i in range(N): if l[i] <= M: ans[l[i] - 1] += 1 for i in range(M): print(i + 1, ans[i])