# coding: utf-8 # Your code here! N,M=map(int,input().split()) L=list(map(lambda x : int(x)-1,input().split())) #print(L) ans=[0]*2*10**5 for item in L: ans[item]+=1 for i in range(M): print(i+1,ans[i])