n,m = map(int,input().split()) *a, = map(int,input().split()) r = [0]*(1+m) for ai in a: if ai <= m: r[ai] += 1 for i in range(1,m+1): print(i,r[i])