from collections import Counter N, M = map(int, input().split()) A = Counter(list(map(int, input().split()))) for i in range(1, M+1): print(i, A[i])