N,M=map(int,input().split()) L=list(map(int,input().split())) D={} for i in range(N): if L[i] not in D: D[L[i]]=1 else: D[L[i]]+=1 for i in range(1,M+1): if i not in D: print(i,0) else: print(i,D[i])