n,m = map(int,input().split()) l = list(map(int,input().split())) ans = [0] * (10**5*2+1) for i in l: ans[i] += 1 for i in range(1,m+1): print(i,ans[i])