k=P=1 exec'if(set(`k`)<=set("2357"))*P%k:print k\nP*=k;k+=1\n'*9999