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