q,x = [int(x) for x in input().split()]
existing = {}
curmex = 0 
ifmex = 1
for i in range(q):
    y = int(input())
    orgin = y%x
    if orgin not in existing:
        existing[orgin]=1
    else:
        existing[orgin+x*existing[orgin]]=1
        existing[orgin]+=1

    if ifmex in existing:
        ifmex+=1
    if curmex in existing:
        curmex=ifmex

    print(curmex)
