#include using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(nullptr); int H,W; cin >> H >> W; int n = 0; vector> P; vector> B; for(int i=0; i> a; long long S = 1LL< (a^v)) a = a^v,S ^= s; if(a == 0) continue; P.push_back({i,k}),B.push_back({a,S}),n++; } int Q; cin >> Q; while(Q--){ long long x; cin >> x; if(x == 0){ cout << "4\n"; cout << "1 1\n"; cout << "1 2\n"; cout << "1 1\n"; cout << "1 2\n"; continue; } long long use = 0; for(auto [v,s] : B) if(x > (x^v)) x = x^v,use ^= s; if(x){cout << "-1\n"; continue;} vector> V(H,vector(W)); for(int i=0; i> answer; for(int x=H-1; x>=0; x--){ vector Y; for(int y=0; y