n,m = map(int, input().split()) L = list(map(int, input().split())) from collections import Counter C = Counter(L) for i in range(1, m+1): if i not in C: print(i, 0) else: print(i, C[i])