Problem: The Galaxy contains n planets, there are many different living creatures inhabiting each planet. And each creature can get into troubles! Space rescuers know it perfectly well and they are always ready to help anyone who really needs help. All you need to do is call for them. 

Now the space rescuers plan to build the largest in the history of the Galaxy rescue station; however, the rescue station's location is yet to be determined. As some cases are real emergencies, the rescuers want to find such a point in the Galaxy from which it would be possible to get to the remotest planet in the minimum possible time. In other words, the rescuers need such point in the space that the distance between it and the planet remotest from it was minimal (if we compare this point with all other possible points in the space). Unfortunately, the rescuers can't sole this problem.

As the planets are quite remote from each other, they can be considered as points in Euclidean three-dimensional space. The distance between points (xi, yi, zi) and (xj, yj, zj) can be calculated by the formula <image>. The rescue station can be positioned in any point in the space. It can also coincide with some planet. 

Galaxy is in danger! Save the space rescuers and find the required point for them.

Input

The first line of the input file contains integer n — the number of planets (1 ≤ N ≤ 100). Each of the following n lines contains information about the planets. The i-th line contains three integers xi, yi, zi — the coordinates of the i-th planet ( - 104 ≤ xi, yi, zi ≤ 104, 1 ≤ i ≤ n). No two planets coincide.

Output

Print on the first line of the output file three space-separated real numbers x0, y0, z0 — the coordinates for the future base. If there are several solutions, you are allowed to print any of them. The answer will be accepted if the distance from this point to the remotest planet will differ from the juries' variant in no more than 10 - 6 in absolute or relative value.

Examples

Input

5
5 0 0
-5 0 0
0 3 4
4 -3 0
2 2 -2


Output

0.000 0.000 0.000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
int n;
double x, y, z;
double planet[200][3];
double xMin = 9999999, xMax = -9999999;
double yMin = 9999999, yMax = -9999999;
double zMin = 9999999, zMax = -9999999;
inline double dist(double x1, double y1, double z1, double x2, double y2,
                   double z2) {
  return sqrt((x2 - x1) * (x2 - x1) + (y2 - y1) * (y2 - y1) +
              (z2 - z1) * (z2 - z1));
}
double maxDistance(double x1, double y1, double z1) {
  double maxDistance = -1;
  for (int i = 0; i < n; i++) {
    double distance = sqrt((planet[i][0] - x1) * (planet[i][0] - x1) +
                           (planet[i][1] - y1) * (planet[i][1] - y1) +
                           (planet[i][2] - z1) * (planet[i][2] - z1));
    if (distance > maxDistance) {
      maxDistance = distance;
    }
  }
  return maxDistance;
}
double dist1(double x, double y) {
  double zLeft = -10000;
  double zRight = 10000;
  double z1, z2;
  double maxDist1, maxDist2, max = 0;
  while ((zRight - zLeft) > 0.000001) {
    z1 = zLeft + (zRight - zLeft) / 3.0;
    maxDist1 = maxDistance(x, y, z1);
    z2 = zLeft + 2.0 * (zRight - zLeft) / 3.0;
    maxDist2 = maxDistance(x, y, z2);
    if (maxDist1 < maxDist2) {
      zRight = z2;
      max = maxDist2;
      z = z2;
    } else {
      zLeft = z1;
      z = z1;
      max = maxDist1;
    }
  }
  return max;
}
double dist2(double x) {
  double yLeft = -10000.0;
  double yRight = 10000.0;
  double y1, y2;
  double maxDist1, maxDist2, max = 0;
  while ((yRight - yLeft) > 0.000001) {
    y1 = yLeft + (yRight - yLeft) / 3.0;
    maxDist1 = dist1(x, y1);
    y2 = yLeft + 2.0 * (yRight - yLeft) / 3.0;
    maxDist2 = dist1(x, y2);
    if (maxDist1 < maxDist2) {
      yRight = y2;
      max = maxDist2;
      y = y2;
    } else {
      yLeft = y1;
      y = y1;
      max = maxDist1;
    }
  }
  return max;
}
double dist3() {
  double xLeft = -10000.0;
  double xRight = 10000.0;
  double x1, x2;
  double maxDist1, maxDist2, max = 0;
  while ((xRight - xLeft) > 0.000001) {
    x1 = xLeft + (xRight - xLeft) / 3.0;
    maxDist1 = dist2(x1);
    x2 = xLeft + 2.0 * (xRight - xLeft) / 3.0;
    maxDist2 = dist2(x2);
    if (maxDist1 < maxDist2) {
      xRight = x2;
      max = maxDist2;
      x = x2;
    } else {
      xLeft = x1;
      x = x1;
      max = maxDist1;
    }
  }
  return max;
}
void read() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%lf", &planet[i][0]);
    scanf("%lf", &planet[i][1]);
    scanf("%lf", &planet[i][2]);
    if (planet[i][0] > xMax) xMax = planet[i][0];
    if (planet[i][0] < xMin) xMin = planet[i][0];
    if (planet[i][1] > yMax) yMax = planet[i][1];
    if (planet[i][1] < yMin) yMin = planet[i][1];
    if (planet[i][2] > zMax) zMax = planet[i][2];
    if (planet[i][2] < zMin) zMin = planet[i][2];
  }
}
int main() {
  read();
  if (n == 1) {
    printf("%f %f %f", planet[0][0], planet[0][1], planet[0][2]);
    return 0;
  }
  x = y = z = 0;
  double fact = 1.0;
  for (int t = 0; t < 20000; t++) {
    int ind = 0;
    double maxDistance = -1;
    for (int i = 0; i < n; i++) {
      double distance = sqrt((planet[i][0] - x) * (planet[i][0] - x) +
                             (planet[i][1] - y) * (planet[i][1] - y) +
                             (planet[i][2] - z) * (planet[i][2] - z));
      if (distance > maxDistance) {
        maxDistance = distance;
        ind = i;
      }
    }
    x += fact * (planet[ind][0] - x);
    y += fact * (planet[ind][1] - y);
    z += fact * (planet[ind][2] - z);
    fact *= 0.999;
  }
  printf("%lf %lf %lf \n", x, y, z);
  return 0;
}