#include <iostream>
#include <string>
#include <sstream>
#include <cmath>
#include <vector>
const double MIN_INIT = 10000;
using namespace std;
struct coord {
double x, y, z;
coord(double x, double y, double z) { this->x = x; this->y = y; this->z = z; }
};
int main() {
string buff;
vector<coord> v;
double max = 0.0, min = MIN_INIT;
while (getline(cin, buff)) {
stringstream s;
double x, y, z;
s << buff;
s >> x >> y >> z;
for (vector<coord>::iterator p = v.begin(); p != v.end(); p++) {
double d;
d = sqrt((p->x - x) * (p->x - x) + (p->y - y) * (p->y - y) + (p->z - z) * (p->z - z));
if (d > max)
max = d;
if (d < min)
min = d;
}
v.push_back(coord(x, y, z));
}
cout << "max = " << max << endl;
cout << "min = " << min << endl;
return 0;
}
/* end */