How to implement XOR operation on a 2D segment tree for CodeForces 242E problem?