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