n = int(input())
for i in range(1, n):
flag = True
for k in str(i):
try:
if i % int(k) != 0:
flag = False
except:
if flag == True:
print(i)
возможно можно проще))
n = int(input())
for i in range(1, n):
flag = True
for k in str(i):
try:
if i % int(k) != 0:
flag = False
except:
flag = False
if flag == True:
print(i)
возможно можно проще))