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