l="2357" for i in range(9999): a=1 for j in`i`:a*=j in l if a: for j in range(2,i):a*=i%j if a:print i