#include #include #include #include #include #define ll long long #define inf 1e9 #define eps 1e-10 #define md #define N 1010 using namespace std; int a[N][N],c[N][N]; int n,m; int qsum(int x,int y) { int ans=0; for (int i=x;i;i-=i&(-i)) for (int j=y;j;j-=j&(-j)) ans^=c[i][j]; return ans; } void add(int x,int y,int d) { for (int i=x;i<=n;i+=i&(-i)) for (int j=y;j<=m;j+=j&(-j)) c[i][j]^=d; } int main() { int tt; scanf("%d",&tt); while (tt--) { int q; memset(c,0,sizeof(c)); scanf("%d%d%d",&n,&m,&q); for (int i=1;i<=n;i++) for (int j=1;j<=m;j++) { scanf("%d",&a[i][j]); add(i,j,a[i][j]); } for (int i=1;i<=q;i++) { int opt; scanf("%d",&opt); if (opt==1) { int x1,x2,y1,y2; scanf("%d%d%d%d",&x1,&y1,&x2,&y2); int ans=qsum(x2,y2)^qsum(x1-1,y2)^qsum(x2,y1-1)^qsum(x1-1,y1-1); if (ans) printf("Yes\n"); else printf("No\n"); } else { int x,y,z; scanf("%d%d%d",&x,&y,&z); add(x,y,a[x][y]); add(x,y,z); a[x][y]=z; } } } return 0; }