#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;
}