#include <bits/stdc++.h>
using namespace std;
int main() {
int t,n,m,i,j; cin >> t;
map<int,pair<int,int>> cd;
while(t--){
cd.clear();
cin >> n >> m >> i >> j;
cd[abs(i-1) + abs(j-1)] = {1,1};
cd[abs(i-1) + abs(j-m)] = {1,m};
cd[abs(i-n) + abs(j-1)] = {n,1};
cd[abs(i-n) + abs(j-m)] = {n,m};
auto it1 = cd.rbegin();
cout << "1 1 " << (it1->second).first << " " << (it1->second).second << endl;
}
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CnVzaW5nIG5hbWVzcGFjZSBzdGQ7CgppbnQgbWFpbigpIHsKCWludCB0LG4sbSxpLGo7CWNpbiA+PiB0OwoJbWFwPGludCxwYWlyPGludCxpbnQ+PiBjZDsKCXdoaWxlKHQtLSl7CgkJY2QuY2xlYXIoKTsKCQljaW4gPj4gbiA+PiBtID4+IGkgPj4gajsKCQljZFthYnMoaS0xKSArIGFicyhqLTEpXSA9IHsxLDF9OwoJCWNkW2FicyhpLTEpICsgYWJzKGotbSldID0gezEsbX07CgkJY2RbYWJzKGktbikgKyBhYnMoai0xKV0gPSB7biwxfTsKCQljZFthYnMoaS1uKSArIGFicyhqLW0pXSA9IHtuLG19OwoJCQoJCWF1dG8gaXQxID0gY2QucmJlZ2luKCk7CgkJCgkJY291dCA8PCAiMSAxICIgPDwgKGl0MS0+c2Vjb25kKS5maXJzdCA8PCAgIiAiIDw8IChpdDEtPnNlY29uZCkuc2Vjb25kIDw8IGVuZGw7CgkJCgl9CgkKCSAKCXJldHVybiAwOwp9