n,m=map(int,input().split()) L=list(map(int,input().split())) from collections import Counter c=Counter(L) for i in range(m): print(i+1,c[i+1])