K=int(input()) P=int(input()) t=int(input("Введите последнюю цифру t: ")) for i in range(K,P+1): if i%10!=t: continue print(i)