import collections N, M = map(int, input().split(' ')) C = collections.Counter(list(map(int, input().split(' ')))) for i in range(1, M+1): print(f'{i} {C[i]}')