first = input() first_split = first.split(" ") seconder = input() seconder_split = seconder.split(" ") numest = 1 numester=0 first_first = int(first_split[0]) first_max = int(first_split[1]) count=0 while(numest <= first_max): while(numester < first_first): if(numest== int(seconder_split[numester])): count=count+1 numester=numester+1 print(str(numest)+" "+str(count)) count=0 numester=0 numest=numest+1