a,b = map(int,input().split()) l = list(map(int,input().split())) for i in range(1,b+1): print(i,l.count(i))