for(n=1,999,t=50;x=n;while(x*t---t,x=(x%2*x*23+x+2)\4);print(if(t,49-t,Infinity)", "n))