n,m=map(int,input().split()) ans=[0]*200000 l=list(map(int,input().split())) for i in l: ans[i-1]+=1 for i in range(m): print(i+1,l[i])