N,M = list(map(int,input().split())) L = list(map(int,input().split())) count = [0] * (2 * 10 ** 5 + 1) for i in L: count[i] += 1 for i in range(1,M+1): print(i,count[i])