import collections n,m=map(int,input().split()) arr=list(map(int,input().split())) cnt=collections.Counter(arr) for i in range(1,m+1): if i not in cnt: print("{} {}".format(i,0)) else: print("{} {}".format(i,cnt[i]))