#include <iostream>
#include <fstream>

using namespace std;

int main()
{
	ifstream in("SEGMENT.IN");

	int n;
	in>>n;
	while(n--)
	{
		long x1,x2,y1,y2;
		in>>x1>>y1>>x2>>y2;

		x2-=x1;
		y2-=y1;

		if(x2==y2)
		{
			cout<<x2+1<<endl;
			continue;
		}
		if(x2>y2)
		{
			cout<<x2+1<<endl;
			continue;
		}
		else
			cout<<y2+1<<endl;
	}

	return 0;
}