#include #include #include #include #include #include using namespace std; typedef long long ll; typedef long double ld; typedef pair pr; const double pi=acos(-1); #define rep(i,a,n) for(int i=a;i<=n;i++) #define per(i,n,a) for(int i=n;i>=a;i--) #define Rep(i,u) for(int i=head[u];i;i=Next[i]) #define clr(a) memset(a,0,sizeof a) #define pb push_back #define mp make_pair #define fi first #define sc second ld eps=1e-9; ll pp=1000000007; ll mo(ll a,ll pp){if(a>=0 && a>=1,a=mo(a*a,pp))if(b&1)ans=mo(ans*a,pp);return ans;} ll read(){ ll ans=0; char last=' ',ch=getchar(); while(ch<'0' || ch>'9')last=ch,ch=getchar(); while(ch>='0' && ch<='9')ans=ans*10+ch-'0',ch=getchar(); if(last=='-')ans=-ans; return ans; } //head int a[600][600],n,m,Q,c[600][600]; int lowbit(int x){ return x&(-x); } void add(int x,int y,int z){ for(;x<=n;x+=lowbit(x)) for(int j=y;j<=m;j+=lowbit(j))c[x][j]^=z; } int get(int x,int y){ int ans=0; for(;x;x-=lowbit(x)) for(int j=y;j;j-=lowbit(j))ans^=c[x][j]; return ans; } int main(){ int T=read(); while(T--){ n=read(),m=read(),Q=read(); rep(i,1,n) rep(j,1,m)c[i][j]=0; rep(i,1,n) rep(j,1,m){ a[i][j]=read(); add(i,j,a[i][j]); } while(Q--){ int kk=read(); if(kk==1){ int t1=read(),t2=read(),t3=read(),t4=read(); int z=get(t3,t4)^get(t1-1,t4)^get(t3,t2-1)^get(t1-1,t2-1); if(z)printf("Yes\n"); else printf("No\n"); } else{ int x=read(),y=read(),z=read(); add(x,y,a[x][y]^z); a[x][y]=z; } } } return 0; }