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