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;
  }
  ~Pt3d(){};
};
class Pt2d {
 public:
  double x, y;
  int Tang;
  Pt2d() {}
  Pt2d(double x, double y, int t = -1) {
    this->x = x;
    this->y = y;
    Tang = t;
  }
  void operator=(const Pt2d &pt2) {
    this->x = pt2.x;
    this->y = pt2.y;
    this->Tang = pt2.Tang;
  }
  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;
  }
};
int n, m;
Pt3d pt3[1000];
Pt2d pt[1000];
Pt2d rCenter;
double r = 0.0;
int idMPt[2] = {0, 1};
std::vector<Pt2d> ptR;
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) {
  Pt2d res;
  res.x = (pt1.x + pt2.x) / 2;
  res.y = (pt1.y + pt2.y) / 2;
  return res;
}
struct MyLine {
  double A, B, C;
  MyLine() {}
};
void calcLine(Pt2d pt2d, MyLine &myline) {
  myline.C = -pt2d.x * myline.A - pt2d.y * myline.B;
}
Pt2d calcRCenter(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]);
  res.x = (-myline[0].C * myline[1].B + myline[1].C * myline[0].B) /
          (myline[0].A * myline[1].B - myline[1].A * myline[0].B);
  res.y = (-myline[0].A * myline[1].C + myline[1].A * myline[0].C) /
          (myline[0].A * myline[1].B - myline[1].A * myline[0].B);
  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 newRCenter;
  vector<Pt2d> resvec;
  resvec.push_back(ptR[ptR.size() - 1]);
  bool flag = false;
  bool resizeR = false;
  double newR;
  unsigned int superPt = 1111111;
  for (unsigned int i = 0; i < ptR.size() - 1; ++i) {
    newRCenter = centerPt2(resvec[0], ptR[i]);
    newR = lenPt2(newRCenter, resvec[0]);
    if (resizeR && newR > r) continue;
    flag = true;
    for (unsigned int j = 0; j < ptR.size() - 1; ++j)
      if (j != i) {
        double d = lenPt2(newRCenter, ptR[j]);
        if (d > newR + eps) {
          flag = false;
          break;
        }
      }
    if (flag) {
      superPt = i;
      r = newR;
      rCenter = newRCenter;
      resizeR = true;
    }
  }
  if (resizeR) {
    resvec.push_back(ptR[superPt]);
    ptR = resvec;
    return;
  }
  unsigned int arr[2] = {111111, 111111};
  resizeR = false;
  for (unsigned int i = 0; i < ptR.size(); ++i)
    for (unsigned int j = i + 1; j < ptR.size(); ++j)
      if (!isOneLine(ptR[i], ptR[j], resvec[0])) {
        newRCenter = calcRCenter(resvec[0], ptR[i], ptR[j]);
        newR = lenPt2(newRCenter, resvec[0]);
        if (resizeR && newR > r) continue;
        flag = true;
        for (unsigned int k = 0; k < ptR.size(); ++k)
          if (k != i && k != j) {
            double d = lenPt2(newRCenter, ptR[k]);
            if (d > newR + eps) {
              flag = false;
              break;
            }
          }
        if (flag) {
          rCenter = newRCenter;
          r = newR;
          arr[0] = i;
          arr[1] = j;
          resizeR = true;
        }
      }
  if (arr[0] > 900 || arr[1] > 900) {
    printf("ERROR!");
    return;
  }
  resvec.push_back(ptR[arr[0]]);
  resvec.push_back(ptR[arr[1]]);
  ptR = resvec;
}
bool isOutCircle(unsigned int &id) { return lenPt2(rCenter, pt[id]) > r + eps; }
void calcNewR(unsigned int id) {
  ptR.push_back(pt[id]);
  createCircle();
  bool flag = true;
  while (flag) {
    flag = false;
    for (unsigned int i = 0; i < id; ++i) {
      if (isOutCircle(i)) {
        ptR.push_back(pt[i]);
        createCircle();
        flag = true;
        break;
      }
    }
  }
}
double calcR() {
  if (n == 1) return 0;
  ptR.clear();
  ptR.push_back(pt[0]);
  ptR.push_back(pt[1]);
  rCenter = centerPt2(ptR[0], ptR[1]);
  r = lenPt2(ptR[0], rCenter);
  for (int i = 2; i < n; ++i) {
    double d = lenPt2(rCenter, pt[i]);
    if (fabs(d - r) < eps) ptR.push_back(pt[i]);
  }
  for (int j = 2; j < n; ++j)
    if (lenPt2(rCenter, pt[j]) > r + eps) {
      calcNewR(j);
    }
  return r;
}
double calcR2() {
  if (n == 1) return 0;
  vector<Pt2d> ans;
  double r = 1e18;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      Pt2d newRCenter = centerPt2(pt[i], pt[j]);
      double newR = lenPt2(pt[i], newRCenter);
      bool flag = true;
      for (int k = 0; k < n; ++k) {
        if (lenPt2(pt[k], newRCenter) > newR + eps) {
          flag = false;
          break;
        }
      }
      if (flag && newR < r) {
        r = newR;
        ans.resize(2);
        ans[0] = pt[i];
        ans[1] = pt[j];
      }
    }
  if (r == 1e18) {
    for (int i = 0; i < n; ++i)
      for (int j = i + 1; j < n; ++j)
        for (int k = j + 1; k < n; ++k) {
          Pt2d newRCenter = calcRCenter(pt[i], pt[j], pt[k]);
          double newR = lenPt2(pt[i], newRCenter);
          bool flag = true;
          for (int h = 0; h < n; ++h) {
            if (lenPt2(pt[h], newRCenter) > newR + eps) {
              flag = false;
              break;
            }
          }
          if (flag && newR < r) {
            r = newR;
            ans.resize(3);
            ans[0] = pt[i];
            ans[1] = pt[j];
            ans[2] = pt[k];
          }
        }
  }
  for (unsigned int i = 0; i < ans.size(); ++i) printf("%d ", ans[i].Tang);
  cout << endl;
  return r;
}
Pt2d calcPt2fromPt3(int a, int b, int c, int d, int e, int f) {
  if (a == 0 && b == 0) return Pt2d(d, e);
  if (b == 0 && c == 0) return Pt2d(e, f);
  if (c == 0 && a == 0) return Pt2d(f, d);
  double t = -(a * d + b * e + c * f + 0.0) / (a * a + b * b + c * c);
  double x = d + t * a, y = e + t * b, z = f + 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] = calcPt2fromPt3(A, B, C, pt3[j].x, pt3[j].y, pt3[j].z);
      pt[j].Tang = j + 1;
    }
    printf("%.7f\n", calcR());
  }
  return 0;
}