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 m >= l[i]: ans[l[i] - 1] += 1 for i in range(m): print(i + 1, ans[i])