from collections import Counter N, M, *L = map(int, open(0).read().split()) C = Counter(L) for i in range(1, M + 1): print(i, C[i])