n,m=map(int,input().split()) L=list(map(int,input().split())) for i in range(m): print(i+1,L.count(i+1))