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>
const double eps = 1e-12;
struct point3D {
  double x, y, z;
} p[105], outer[4], ret;
int nouter;
double radius;
double dissqr3D(point3D p1, point3D p2) {
  double dx = p1.x - p2.x, dy = p1.y - p2.y, dz = p1.z - p2.z;
  return dx * dx + dy * dy + dz * dz;
}
double dot(point3D p1, point3D p2) {
  return p1.x * p2.x + p1.y * p2.y + p1.z * p2.z;
}
void ball() {
  point3D q[3];
  double m[3][3], sol[3], L[3], det;
  int i, j;
  ret.x = ret.y = ret.z = radius = 0;
  switch (nouter) {
    case 1:
      ret = outer[0];
      break;
    case 2:
      ret.x = (outer[0].x + outer[1].x) / 2;
      ret.y = (outer[0].y + outer[1].y) / 2;
      ret.z = (outer[0].z + outer[1].z) / 2;
      radius = dissqr3D(ret, outer[0]);
      break;
    case 3:
      for (i = 0; i < 2; i++) {
        q[i].x = outer[i + 1].x - outer[0].x;
        q[i].y = outer[i + 1].y - outer[0].y;
        q[i].z = outer[i + 1].z - outer[0].z;
      }
      for (i = 0; i < 2; i++)
        for (j = 0; j < 2; j++) m[i][j] = dot(q[i], q[j]) * 2;
      for (i = 0; i < 2; i++) sol[i] = dot(q[i], q[i]);
      if (fabs(det = m[0][0] * m[1][1] - m[0][1] * m[1][0]) < eps) return;
      L[0] = (sol[0] * m[1][1] - sol[1] * m[0][1]) / det;
      L[1] = (sol[1] * m[0][0] - sol[0] * m[1][0]) / det;
      ret.x = outer[0].x + q[0].x * L[0] + q[1].x * L[1];
      ret.y = outer[0].y + q[0].y * L[0] + q[1].y * L[1];
      ret.z = outer[0].z + q[0].z * L[0] + q[1].z * L[1];
      radius = dissqr3D(ret, outer[0]);
      break;
    case 4:
      for (i = 0; i < 3; i++) {
        q[i].x = outer[i + 1].x - outer[0].x;
        q[i].y = outer[i + 1].y - outer[0].y;
        q[i].z = outer[i + 1].z - outer[0].z;
        sol[i] = dot(q[i], q[i]);
      }
      for (i = 0; i < 3; i++)
        for (j = 0; j < 3; j++) m[i][j] = dot(q[i], q[j]) * 2;
      det = m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0] +
            m[0][2] * m[2][1] * m[1][0] - m[0][2] * m[1][1] * m[2][0] -
            m[0][1] * m[1][0] * m[2][2] - m[0][0] * m[1][2] * m[2][1];
      if (fabs(det) < eps) return;
      for (j = 0; j < 3; j++) {
        for (i = 0; i < 3; i++) m[i][j] = sol[i];
        L[j] = (m[0][0] * m[1][1] * m[2][2] + m[0][1] * m[1][2] * m[2][0] +
                m[0][2] * m[2][1] * m[1][0] - m[0][2] * m[1][1] * m[2][0] -
                m[0][1] * m[1][0] * m[2][2] - m[0][0] * m[1][2] * m[2][1]) /
               det;
        for (i = 0; i < 3; i++) m[i][j] = dot(q[i], q[j]) * 2;
      }
      ret = outer[0];
      for (i = 0; i < 3; i++) {
        ret.x += q[i].x * L[i];
        ret.y += q[i].y * L[i];
        ret.z += q[i].z * L[i];
      }
      radius = dissqr3D(ret, outer[0]);
  }
}
void minball(int n) {
  ball();
  if (nouter < 4)
    for (int i = 0; i < n; i++)
      if (dissqr3D(ret, p[i]) - radius > eps) {
        outer[nouter] = p[i];
        ++nouter;
        minball(i);
        --nouter;
        if (i > 0) {
          point3D tmp = p[i];
          memmove(&p[1], &p[0], sizeof(point3D) * i);
          p[0] = tmp;
        }
      }
}
int main() {
  int n;
  while (scanf("%d", &n) + 1) {
    for (int i = 0; i < n; i++) scanf("%lf%lf%lf", &p[i].x, &p[i].y, &p[i].z);
    minball(n);
    printf("%.10lf %.10lf %.10lf\n", ret.x, ret.y, ret.z);
  }
}