s1=[i for i in range(1,1000) if (i%3==0)&(i%7==0)]
print([i for i in range(3,1001,3) if i%7!=0 and i%9!=0])