($A,$B)=glob<>; $N=$A+$B; printf grep/-/||$_!=$A&&$_!=$B&&($A+$_)%$B<1&&($B+$_)%$A<1,(@_=grep$N%$_<1,1..sqrt$N),(map$N/$_,reverse@_),-1