If infinitely many solutions available
if ( noOfSolutions == - 1 ) { document . write ( " " + A + " " + B + " " + " " + " " + A + " " ) ; } else { document . write ( " " + A + " " + B + " " + noOfSolutions + " " + " " ) ; } }