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