p=i=1 while i<8e3:len(set('2357%d'%i))+~p%i<5==print(i);p*=i;i+=1