from collections import defaultdict N, M = map(int, input().split()) L = list(map(int, input().split())) D = defaultdict(int) for l in L: D[l]+=1 for i in range(1, M+1): print(i, D[i])