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