p F[gets.hex,2e13,0]while F=proc{|a,b,r|b>(x=a%t=16**r+=1)&&x>t/17&&(a