N,M=map(int,input().split()) L=list(map(int,input().split())) backet=dict(zip(range(1,M+1),[0]*M)) for i in range(N): if 1<=L[i]<=M:backet[L[i]]=backet[L[i]]+1 for i in range(1,M+1): print(i,backet[i])