N, M = map(int, input().split()) L = list(map(int, input().split())) num = [0] * M for i in range(N): if L[i] <= M: num[L[i]-1] += 1 for i, j in enumerate(num): print(i+1, j)