def g(a,b): while b:a,b=b,a%b return a x=range(1,200) z=0 for i in x[:100]: for j in x: if g(j,z)>1:z=j;break if i<3:z=i x.remove(z) print z