import sys input = sys.stdin.readline N, M = map(lambda x: int(x), input().split()) Ls = list(input().split()) for i in range(1, M + 1): print(i, Ls.count(str(i)))