from collections import*;n,m=map(int,input().split());a=Counter(map(int,input().split())) for i in range(1,m+1):print(i,a[i])