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 JAVA):

Solution:
import java.io.*;
import java.util.*;
import java.math.*;

public class P106E {

  final double EPS = 1e-5;

  int n;
  double [] x;
  double [] y;
  double [] z;
  double lx = Double.MAX_VALUE;
  double rx = Double.MIN_VALUE;
  double ly = Double.MAX_VALUE;
  double ry = Double.MIN_VALUE;
  double lz = Double.MAX_VALUE;
  double rz = Double.MIN_VALUE;

  double d(double x0, double y0, double z0, int i) {
    return (x[i] - x0) * (x[i] - x0) + (y[i] - y0) * (y[i] - y0) + (z[i] - z0) * (z[i] - z0);
  }

  double d(int i, int j) {
    return d(x[i], y[i], z[i], j);
  }

  double f(double x0, double y0, double z0) {
    double f = 0.0;
    for (int i = 0; i < n; i++) {
      f = Math.max(f, d(x0, y0, z0, i));
    }
    return f;
  }

  double f(double [] xyz) {
    return f(xyz[0], xyz[1], xyz[2]);
  }

  double calcX(double [] xyz) {
    double lx = this.lx;
    double rx = this.rx;
    double v1 = 0;
    double v2 = 0;
    do {
      double x1 = lx + (rx - lx) / 3.0;
      xyz[0] = x1;
      v1 = calcY(xyz);
      double x2 = rx - (rx - lx) / 3.0;
      xyz[0] = x2;
      v2 = calcY(xyz);
      if (v1 > v2) {
        lx = x1;
      } else {
        rx = x2;
      }
    } while ((rx - lx) > EPS);
    xyz[0] = (lx + rx) / 2.0;
    return (v1 + v2) / 2.0;
  }

  double calcY(double [] xyz) {
    double ly = this.ly;
    double ry = this.ry;
    double v1 = 0;
    double v2 = 0;
    do {
      double y1 = ly + (ry - ly) / 3.0;
      xyz[1] = y1;
      v1 = calcZ(xyz);
      double y2 = ry - (ry - ly) / 3.0;
      xyz[1] = y2;
      v2 = calcZ(xyz);
      if (v1 > v2) {
        ly = y1;
      } else {
        ry = y2;
      }
    } while ((ry - ly) > EPS);
    xyz[1] = (ly + ry) / 2.0;
    return (v1 + v2) / 2.0;
  }

  double calcZ(double [] xyz) {
    double lz = this.lz;
    double rz = this.rz;
    double v1 = 0;
    double v2 = 0;
    do {
      double z1 = lz + (rz - lz) / 3.0;
      xyz[2] = z1;
      v1 = f(xyz);
      double z2 = rz - (rz - lz) / 3.0;
      xyz[2] = z2;
      v2 = f(xyz);
      if (v1 > v2) {
        lz = z1;
      } else {
        rz = z2;
      }
    } while ((rz - lz) > EPS);
    xyz[2] = (lz + rz) / 2.0;
    return (v1 + v2) / 2.0;
  }

  public void run() throws Exception {
    n = nextInt();
    if (n == 1) {
      println(nextDouble() + " " + nextDouble() + " " + nextDouble());
      return;
    }
    if (n == 2) {
      double x1 = nextDouble();
      double y1 = nextDouble();
      double z1 = nextDouble();
      double x2 = nextDouble();
      double y2 = nextDouble();
      double z2 = nextDouble();
      println(((x1 + x2) / 2.0) + " " + ((y1 + y2) / 2.0) + " " + ((z1 + z2) / 2.0));
      return;
    }

    x = new double [n];
    y = new double [n];
    z = new double [n];
    double [] xyz = new double [3];
    
    for (int i = 0; i < n; i++) {
      x[i] = nextDouble();
      lx = Math.min(lx, x[i]);
      rx = Math.max(rx, x[i]);
      y[i] = nextDouble();
      ly = Math.min(ly, y[i]);
      ry = Math.max(ry, y[i]);
      z[i] = nextDouble();
      lz = Math.min(lz, z[i]);
      rz = Math.max(rz, z[i]);
    }

    calcX(xyz);

    println(xyz[0] + " " + xyz[1] + " " + xyz[2]);
  }

  public static void main(String... args) throws Exception {
    br = new BufferedReader(new InputStreamReader(System.in));
    pw = new PrintWriter(new BufferedOutputStream(System.out));
    new P106E().run();
    br.close();
    pw.close();
  }

  static BufferedReader br;
  static PrintWriter pw;
  StringTokenizer stok;

  String nextToken() throws IOException {
    while (stok == null || !stok.hasMoreTokens()) {
      String s = br.readLine();
      if (s == null) {
        return null;
      }
      stok = new StringTokenizer(s);
    }
    return stok.nextToken();
  }

  void print(byte b) {
    print("" + b);
  }

  void print(int i) {
    print("" + i);
  }

  void print(long l) {
    print("" + l);
  }

  void print(double d) {
    print("" + d);
  }

  void print(char c) {
    print("" + c);
  }

  void print(Object o) {
    if (o instanceof int[]) {
      print(Arrays.toString((int [])o));
    } else if (o instanceof long[]) {
      print(Arrays.toString((long [])o));
    } else if (o instanceof char[]) {
      print(Arrays.toString((char [])o));
    } else if (o instanceof byte[]) {
      print(Arrays.toString((byte [])o));
    } else if (o instanceof short[]) {
      print(Arrays.toString((short [])o));
    } else if (o instanceof boolean[]) {
      print(Arrays.toString((boolean [])o));
    } else if (o instanceof float[]) {
      print(Arrays.toString((float [])o));
    } else if (o instanceof double[]) {
      print(Arrays.toString((double [])o));
    } else if (o instanceof Object[]) {
      print(Arrays.toString((Object [])o));
    } else {
      println("" + o);
    }
  }

  void print(String s) {
    pw.print(s);
  }

  void println(byte b) {
    println("" + b);
  }

  void println(int i) {
    println("" + i);
  }

  void println(long l) {
    println("" + l);
  }

  void println(double d) {
    println("" + d);
  }

  void println(char c) {
    println("" + c);
  }

  void println(Object o) {
    print(o);
    println("");
  }

  void println(String s) {
    pw.println(s);
  }

  int nextInt() throws IOException {
    return Integer.parseInt(nextToken());
  }

  long nextLong() throws IOException {
    return Long.parseLong(nextToken());
  }

  double nextDouble() throws IOException {
    return Double.parseDouble(nextToken());
  }

  char nextChar() throws IOException {
    return (char) (br.read());
  }

  String next() throws IOException {
    return nextToken();
  }

  String nextLine() throws IOException {
    return br.readLine();
  }

  int [] readInt(int size) throws IOException {
    int [] array = new int [size];
    for (int i = 0; i < size; i++) {
      array[i] = nextInt();
    }
    return array;
  }

  long [] readLong(int size) throws IOException {
    long [] array = new long [size];
    for (int i = 0; i < size; i++) {
      array[i] = nextLong();
    }
    return array;
  }

  double [] readDouble(int size) throws IOException {
    double [] array = new double [size];
    for (int i = 0; i < size; i++) {
      array[i] = nextDouble();
    }
    return array;
  }

}