n, m = map(int, input().split()) lst = list(map(int, input().split())) cnt = [0 for _ in range(m)] for num in lst: if num > m: continue cnt[num - 1] += 1 for i, num in enumerate(cnt, start = 1): print(i, num)