Checking array with two elements possible or not .
if ( xorr == 1 && mid == 1 ) { document . write ( " " + 3 ) ; document . write ( " " + xorr + " " + mid + " " + mid ) ; } else { document . write ( " " + 2 ) ; document . write ( " " ) document . write ( " " + ( xorr + mid ) + " " + mid ) ; } }