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;
const double eps = 1e-12;
class Pt3d {
 public:
  int x, y, z;
  Pt3d() {}
  Pt3d(int x, int y, int z) {
    this->x = x;
    this->y = y;
    this->z = z;
  }
};
class Pt2d {
 public:
  double x, y;
  Pt2d() {}
  Pt2d(double x, double y, int t = -1) {
    this->x = x;
    this->y = y;
  }
  void operator=(const Pt2d &pt2) {
    this->x = pt2.x;
    this->y = pt2.y;
  }
  friend bool operator==(const Pt2d &pt1, const Pt2d &pt2) {
    return fabs(pt1.x - pt2.x) < eps && fabs(pt1.y - pt2.y) < eps;
  }
  friend bool operator!=(const Pt2d &pt1, const Pt2d &pt2) {
    return fabs(pt1.x - pt2.x) > eps && fabs(pt1.y - pt2.y) > eps;
  }
};
struct MyLine {
  double A, B, C;
  MyLine() {}
};
int n, m;
Pt3d pt3[900];
Pt2d pt[900];
Pt2d rCenter;
double r = 0.0;
unsigned int ptR[4];
unsigned int ptRSize = 0;
void init() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i)
    scanf("%d %d %d", &pt3[i].x, &pt3[i].y, &pt3[i].z);
}
double lenPt2(Pt2d &pt1, Pt2d &pt2) {
  return sqrt(pow(pt1.x - pt2.x, 2.0) + pow(pt1.y - pt2.y, 2.0));
}
Pt2d centerPt2(const Pt2d &pt1, const Pt2d &pt2) {
  return Pt2d((pt1.x + pt2.x) / 2, (pt1.y + pt2.y) / 2);
}
void calcLine(Pt2d pt2d, MyLine &myline) {
  myline.C = -pt2d.x * myline.A - pt2d.y * myline.B;
}
Pt2d centerCircle(const Pt2d &pt1, const Pt2d &pt2) {
  return Pt2d((pt1.x + pt2.x) / 2, (pt1.y + pt2.y) / 2);
}
Pt2d centerCircle(const Pt2d &pt1, const Pt2d &pt2, const Pt2d &pt3) {
  Pt2d res;
  MyLine myline[2];
  myline[0].A = pt1.x - pt2.x;
  myline[0].B = pt1.y - pt2.y;
  calcLine(centerPt2(pt1, pt2), myline[0]);
  myline[1].A = pt1.x - pt3.x;
  myline[1].B = pt1.y - pt3.y;
  calcLine(centerPt2(pt1, pt3), myline[1]);
  double d = (myline[0].A * myline[1].B - myline[1].A * myline[0].B);
  res.x = (-myline[0].C * myline[1].B + myline[1].C * myline[0].B) / d;
  res.y = (-myline[0].A * myline[1].C + myline[1].A * myline[0].C) / d;
  return res;
}
bool isOneLine(const Pt2d &pt1, const Pt2d &pt2, const Pt2d &pt3) {
  return (pt3.x - pt1.x) * (pt2.y - pt1.y) == (pt3.y - pt1.y) * (pt2.x - pt1.x);
}
bool isNotEqual(const Pt2d &pt1, const Pt2d &pt2, const Pt2d &pt3) {
  return pt1 != pt2 && pt2 != pt3;
}
void createCircle() {
  Pt2d *superPt = &pt[ptR[ptRSize - 1]];
  unsigned int arr[2] = {111111, 111111};
  bool flag = true;
  bool resizeR = false;
  for (unsigned int i = 0; i < ptRSize - 1; ++i) {
    Pt2d newRCenter = centerCircle(pt[ptR[i]], *superPt);
    double newR = lenPt2(newRCenter, pt[ptR[i]]);
    if (resizeR && newR > r) continue;
    bool isRightCircle = true;
    for (unsigned int j = 0; j < ptRSize - 1; ++j)
      if (j != i) {
        double d = lenPt2(newRCenter, pt[ptR[j]]);
        if (d > newR + eps) {
          isRightCircle = false;
          break;
        }
      }
    if (isRightCircle) {
      arr[0] = ptR[i];
      r = newR;
      rCenter = newRCenter;
      resizeR = true;
    }
  }
  if (resizeR) {
    ptR[0] = arr[0];
    ptR[1] = ptR[ptRSize - 1];
    ptR[2] = 1111111;
    ptR[3] = 1111111;
    ptRSize = 2;
    rCenter = centerCircle(pt[ptR[0]], pt[ptR[1]]);
    r = lenPt2(rCenter, pt[ptR[0]]);
    return;
  }
  arr[0] = 111111;
  flag = true;
  resizeR = false;
  for (unsigned int i = 0; i < ptRSize - 2; ++i)
    for (unsigned int j = i + 1; j < ptRSize - 1; ++j)
      if (!isOneLine(pt[ptR[i]], pt[ptR[j]], *superPt)) {
        Pt2d newRCenter = centerCircle(*superPt, pt[ptR[i]], pt[ptR[j]]);
        double newR = lenPt2(newRCenter, *superPt);
        if (resizeR && newR > r) continue;
        flag = true;
        for (unsigned int k = 0; k < ptRSize - 1; ++k)
          if (k != i && k != j) {
            double d = lenPt2(newRCenter, pt[ptR[k]]);
            if (d > newR + eps) {
              flag = false;
              break;
            }
          }
        if (flag) {
          rCenter = newRCenter;
          r = newR;
          arr[0] = ptR[i];
          arr[1] = ptR[j];
          resizeR = true;
        }
      }
  ptR[0] = arr[0];
  ptR[1] = arr[1];
  ptR[2] = ptR[ptRSize - 1];
  ptR[3] = 1111111;
  ptRSize = 3;
  rCenter = centerCircle(pt[ptR[0]], pt[ptR[1]], pt[ptR[2]]);
  r = lenPt2(rCenter, pt[ptR[0]]);
}
bool isOutsideCircle(unsigned int &id) {
  return lenPt2(rCenter, pt[id]) > r + eps;
}
void calcNewR(unsigned int id) {
  ptR[ptRSize] = id;
  ++ptRSize;
  createCircle();
  bool flag = true;
  while (flag) {
    flag = false;
    for (unsigned int i = 0; i < id; ++i)
      if (i != ptR[0] && i != ptR[1] && i != ptR[2] && i != ptR[3]) {
        if (lenPt2(rCenter, pt[i]) > r + eps) {
          ptR[ptRSize] = i;
          ++ptRSize;
          createCircle();
          flag = true;
          break;
        }
      }
  }
}
double calcR() {
  if (n == 1) return 0;
  ptRSize = 2;
  ptR[0] = 0;
  ptR[1] = 1;
  ptR[2] = 100000;
  ptR[3] = 100000;
  rCenter = centerPt2(pt[ptR[0]], pt[ptR[1]]);
  r = lenPt2(pt[ptR[0]], rCenter);
  for (int j = 2; j < n; ++j)
    if (lenPt2(rCenter, pt[j]) > r + eps) {
      calcNewR(j);
    }
  return r;
}
Pt2d calcPt2d(int &A, int &B, int &C, Pt3d &pt3d) {
  if (A == 0 && B == 0) return Pt2d(pt3d.x, pt3d.y);
  if (B == 0 && C == 0) return Pt2d(pt3d.y, pt3d.z);
  if (C == 0 && A == 0) return Pt2d(pt3d.z, pt3d.x);
  double t =
      -(A * pt3d.x + B * pt3d.y + C * pt3d.z) / (double)(A * A + B * B + C * C);
  double x = pt3d.x + t * A, y = pt3d.y + t * B, z = pt3d.z + t * C;
  double aa = sqrt(x * x + y * y + z * z), bb = sqrt(B * B + C * C),
         cc = sqrt(x * x + (C + y) * (C + y) + (z - B) * (z - B));
  if (fabs(aa) < eps) return Pt2d(0, 0);
  double ang = acos((aa * aa + bb * bb - cc * cc) / (2 * aa * bb));
  if (x < 0) ang = -ang;
  return Pt2d(aa * cos(ang), aa * sin(ang));
}
int main() {
  init();
  for (int i = 0; i < m; ++i) {
    int A, B, C;
    scanf("%d %d %d", &A, &B, &C);
    for (unsigned int j = 0; j < (unsigned int)n; ++j) {
      pt[j] = calcPt2d(A, B, C, pt3[j]);
    }
    printf("%.7f\n", calcR());
  }
  return 0;
}