aa
#include <iostream>
#include <string>
#include <math.h>
using namespace std;
class Point
{
friend double Distance(Point &a, Point &b);
private:
double x, y;
public:
Point(double xx, double yy);
};
Point::Point(double xx, double yy)
{
x = xx;
y = yy;
}
double Distance(Point &a, Point &b)
{
double d,dx,dy;
dx = (a.x - b.x)*(a.x - b.x);
dy = (a.y - b.y)*(a.y - b.y);
d = sqrt(dx + dy);
return d;
}
int main()
{
int t,p1x,p2x,p1y,p2y;
cin >> t;
while (t--)
{
cin >> p1x >> p1y >> p2x >> p2y;
Point p1(p1x,p1y);
Point p2(p2x,p2y);
cout << int(Distance(p1, p2)) << endl;
}
return 0;
}