for i in range(7758): if(set(`i`)<=set('2357'))&all(i%j for j in range(2,i)):print i