N, M = map(int, input().split()) L = list(map(int, input().split())) Ans = [0] * (2*10**5+1) for i in L: Ans[i] += 1 for j in range(M): print(j+1, Ans[j+1])