N,M=map(int,input().split()) L=list(map(int,input().split())) X=[0]*200001 for i in L: X[i]+=1 for i in range(1,M+1): print(i,X[i])