#include<iostream>
#include<cmath>
using namespace std;
class point
{
private:
double x, y, z;
public:
point(double x1, double y1, double z1)
{
x = x1;
y = y1;
z = z1;
}
friend double operator -(point p1, point p2);
};
double operator -(point p1, point p2)
{
return sqrt(pow(p1.x - p2.x, 2.0) + pow(p1.y - p2.y, 2.0) + pow(p1.z - p2.z, 2.0));
}
template < class T>
double dist(T a, T b)
{
return abs(a-b);
}
//template <class T>
int main()
{
int a;
cin >> a;
while (a != 0)
{
if (a == 1)
{
int c, d;
cin >> c >> d;
cout << dist(c, d);
}
if (a == 2)
{
float c, d;
cin >> c >> d;
cout << dist(c, d);
}
if (a == 3)
{
double a1, b1, c1, a2, b2, c2;
cin >> a1 >> b1 >> c1 >> a2 >> b2 >> c2;
point p1(a1, b1, c1);
point p2(a2, b2, c2);
cout << dist(p1, p2);
}
cin >> a;
}
return 0;
}