l,r,x=map(int,input().split())

for i in range(l,r+1):

    if i%x==0:

        print(i)

        break

    else:

        print(-1)