This function receives l and r representing the indices and prints the required output
function query ( l , r ) { if ( ( sum [ r + 1 ] - sum [ l ] ) % 3 == 0 ) { document . write ( " " + " " ) ; } else { document . write ( " " + " " ) ; } }