Function to update and print the matrix after performing queries
function updateMatrix ( n , q , mat ) { let i , j ; for ( i = 0 ; i < q . length ; i ++ ) { let X1 = q [ i ] [ 0 ] ; let Y1 = q [ i ] [ 1 ] ; let X2 = q [ i ] [ 2 ] ; let Y2 = q [ i ] [ 3 ] ;