Problem: In the year of 3000 travelling around parallel realities became a routine thing. However one has to take into consideration that travelling like that is highly dangerous as you never know beforehand where you're gonna get...

Little Vasya, for instance, found himself in a gaming reality and now he has to successfully complete all levels of a very weird game to get back. The gaming reality is a three-dimensional space where n points are given. The game has m levels and at the beginning of the i-th level the player is positioned at some plane Qi that passes through the origin. On each level Vasya has to use special robots to construct and activate n powerful energy spheres of the equal radius with centers at the given points. The player chooses the radius of the spheres himself. The player has to spend R units of money to construct spheres whose radius equals R (consequently, one can construct spheres whose radius equals zero for free). Besides, once for each level a player can choose any point in space and release a laser ray from there, perpendicular to plane Qi (this action costs nothing). The ray can either be directed towards the plane or from the plane. The spheres that share at least one point with the ray will be immediately activated. The level is considered completed if the player has managed to activate all spheres. Note that the centers of the spheres are the same for all m levels but the spheres do not remain: the player should construct them anew on each new level.

Help Vasya find out what minimum sum of money will be enough to complete each level.

Input

The first line contains two integers n and m (1 ≤ n ≤ 900, 1 ≤ m ≤ 100) — the number of energetic spheres and the number of levels in the game correspondingly. 

Each of the following n lines contains three integers xi, yi, zi (0 ≤ xi, yi, zi ≤ 104) — the coordinates of the center of the i-th sphere. Assume that these points do not change their positions throughout the game.

Then follow m lines, each containing three integers ai, bi, ci (0 ≤ ai, bi, ci ≤ 100, ai2 + bi2 + ci2 > 0). These numbers are the coefficients in the equation of plane Qi (aix + biy + ciz = 0), where the player is positioned at the beginning of the i-th level.

Output

Print m numbers, one per line: the i-th line should contain the minimum sum of money needed to complete the i-th level. The absolute or relative error should not exceed 10 - 6.

Examples

Input

4 1
0 0 0
0 1 0
1 0 0
1 1 0
0 0 1


Output

0.7071067812


Input

5 3
0 1 0
1 0 1
1 2 1
2 0 1
1 3 0
1 1 1
1 2 3
3 0 3


Output

1.6329931619
1.6366341768
1.5411035007


Input

2 1
0 20 0
0 0 0
0 10 0


Output

0.0000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int n, m;
double x[1005];
double y[1005];
double z[1005];
double xx[1005];
double yy[1005];
double zz[1005];
void proection(double a, double b, double c, double d = 0) {
  for (int i = 0; i < n; i++) {
    double t = -(d + a * x[i] + b * y[i] + c * z[i]) / (a * a + b * b + c * c);
    xx[i] = x[i] + a * t;
    yy[i] = y[i] + b * t;
    zz[i] = z[i] + c * t;
  }
}
void rotation(double x, double y, double z) {
  double angle = acos(-1.0) / 2 - atan2(z, y);
  double ty = y;
  double tz = z;
  z = cos(angle) * tz + sin(angle) * ty;
  y = -sin(angle) * tz + cos(angle) * ty;
  for (int i = 0; i < n; i++) {
    double ty = yy[i], tz = zz[i];
    zz[i] = cos(angle) * tz + sin(angle) * ty;
    yy[i] = -sin(angle) * tz + cos(angle) * ty;
  }
  angle = acos(-1.0) / 2 - atan2(z, x);
  double tx = x;
  tz = z;
  z = cos(angle) * tz + sin(angle) * tx;
  x = -sin(angle) * tz + cos(angle) * tx;
  for (int i = 0; i < n; i++) {
    double tx = xx[i], tz = zz[i];
    zz[i] = cos(angle) * tz + sin(angle) * tx;
    xx[i] = -sin(angle) * tz + cos(angle) * tx;
  }
}
struct point {
  double x, y;
  point() {
    x = 0;
    y = 0;
  }
  point(double x, double y) {
    this->x = x;
    this->y = y;
  }
} arr[1005];
double dist(point p1, point p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
double det(double a, double b, double c, double d) { return a * d - b * c; }
bool intersect(double a1, double b1, double c1, double a2, double b2, double c2,
               point &ret) {
  double d = det(a1, b1, a2, b2);
  if (fabs(d) < 1e-8) {
    return false;
  }
  ret.x = -det(c1, b1, c2, b2) / d;
  ret.y = -det(a1, c1, a2, c2) / d;
  return true;
}
point get_center(int x, int y, int z) {
  double a1 = arr[y].x - arr[x].x;
  double b1 = arr[y].y - arr[x].y;
  double c1 =
      -(a1 * (arr[y].x + arr[x].x) / 2 + b1 * (arr[y].y + arr[x].y) / 2);
  double a2 = arr[z].x - arr[y].x;
  double b2 = arr[z].y - arr[y].y;
  double c2 =
      -(a2 * (arr[z].x + arr[y].x) / 2 + b2 * (arr[z].y + arr[y].y) / 2);
  point ret;
  if (intersect(a1, b1, c1, a2, b2, c2, ret)) {
    return ret;
  } else {
    throw "Critical error";
  }
}
point mec3(int n, int m) {
  random_shuffle(arr, arr + n);
  double r = dist(arr[n], arr[m]) / 2;
  point center((arr[n].x + arr[m].x) / 2, (arr[n].y + arr[m].y) / 2);
  for (int i = 0; i < n; i++) {
    if (dist(arr[i], center) >= r + 1e-8) {
      center = get_center(i, n, m);
      r = dist(center, arr[n]);
    }
  }
  return center;
}
point mec2(int n) {
  random_shuffle(arr, arr + n);
  double r = dist(arr[0], arr[n]) / 2;
  point center((arr[0].x + arr[n].x) / 2, (arr[0].y + arr[n].y) / 2);
  for (int j = 1; j < n; j++) {
    if (dist(arr[j], center) >= r + 1e-8) {
      center = mec3(j, n);
      r = dist(center, arr[n]);
    }
  }
  return center;
}
point mec1(int n) {
  random_shuffle(arr, arr + n);
  if (n == 1) {
    return arr[0];
  } else {
    double r = dist(arr[0], arr[1]) / 2;
    point center((arr[0].x + arr[1].x) / 2, (arr[0].y + arr[1].y) / 2);
    for (int j = 2; j < n; j++) {
      if (dist(arr[j], center) >= r + 1e-8) {
        center = mec2(j);
        r = dist(center, arr[j]);
      }
    }
    return center;
  }
}
double min_radius(int n) {
  for (int i = 0; i < n; i++) {
    arr[i].x = xx[i];
    arr[i].y = yy[i];
  }
  point center = mec1(n);
  double ret = 0;
  for (int i = 0; i < n; i++) {
    ret = max(ret, dist(arr[i], center));
  }
  return ret;
}
int main() {
  cin >> n >> m;
  for (int i = 0; i < n; i++) {
    cin >> x[i] >> y[i] >> z[i];
  }
  for (int i = 0; i < m; i++) {
    double a, b, c, d = 0;
    cin >> a >> b >> c;
    proection(a, b, c);
    rotation(a, b, c);
    printf("%.10lf\n", min_radius(n));
  }
  return 0;
}