sum != gcd checks that both the numbers are positive or not
if ( __gcd ( gcd , sum - gcd ) == gcd && sum != gcd ) document . write ( " " + Math . min ( gcd , sum - gcd ) + " " + ( sum - Math . min ( gcd , sum - gcd ) ) ) ; else document . write ( - 1 ) ; }