#include<cmath>
#include<cstdio>
#include<algorithm>
#include<string>
#include<vector>
#include<iomanip>
#include<iostream>
using namespace std;
class point
{
private:
double a, b, c;
public:
point() {}
void set()
{
cin >> a >> b >> c;
}
point(double a1, double b1, double c1) :a(a1), b(b1), c(c1) {}
double operator-(point& p)
{
return sqrt((this->a - p.a) * (this->a - p.a) + (this->b - p.b) * (this->b - p.b) + (this->c - p.c) * (this->c - p.c));
}
};
template<class T>
double dist(T a, T b)
{
return abs(a - b);
}
int main()
{
int n;
while (true)
{
cin >> n;
if (n == 0)break;
if (n == 1)
{
int a, b;
cin >> a >> b;
cout << dist(a, b) << endl;
}
else if (n == 2)
{
float a, b;
cin >> a >> b;
cout << dist(a, b) << endl;
}
else {
point a, b;
a.set();
b.set();
cout << dist(a, b) << endl;
}
}
}