<>;@d=sort{$a-$b}glob<>;map$z+=abs,glob<>;print$z?grep($z==$_,@d)?1:grep($z<=($_&1?$b:$a=$_)*2&~$z|$z>=abs$b-$a&$z<=$a+$b,@d)?2:-1:0