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-9;
const int it = 40;
const double inf = 1e9;
const double dlt = (3 + sqrt(5)) / 2;
struct tp {
  double x, y, z;
};
struct tq {
  double a, b, c;
};
int n;
double lt, rt;
tp cp;
tq q;
tp p[1000], pp[1000];
inline bool qq(double a, double b) { return fabs(a - b) < eps; }
inline double sqr(double a) { return a * a; }
inline double dist(const tp &a, const tp &b) {
  return sqr(a.x - b.x) + sqr(a.y - b.y) + sqr(a.z - b.z);
}
inline double solve3(const tq &q, double a, double b) {
  if (!qq(q.a, 0)) {
    cp.y = a;
    cp.z = b;
    cp.x = (-q.b * cp.y - q.c * cp.z) / q.a;
  } else {
    if (!qq(q.b, 0)) {
      cp.x = a;
      cp.z = b;
      cp.y = (-q.a * cp.x - q.c * cp.z) / q.b;
    } else {
      cp.x = a;
      cp.y = b;
      cp.z = (-q.a * cp.x - q.b * cp.y) / q.c;
    }
  }
  double res = 0;
  for (int i = 0; i < n; i++) {
    res = max(res, dist(cp, pp[i]));
  }
  return res;
}
inline double solve2(const tq &q, double a) {
  double l = lt;
  double r = rt;
  double m1 = l + (r - l) / dlt;
  double f1 = solve3(q, a, m1);
  double m2 = r - (r - l) / dlt;
  double f2 = solve3(q, a, m2);
  double res = min(f1, f2);
  for (int i = 0; i < it; i++) {
    if (f1 < f2) {
      r = m2;
      m2 = m1;
      f2 = f1;
      m1 = l + (r - l) / dlt;
      f1 = solve3(q, a, m1);
      res = min(res, f1);
    } else {
      l = m1;
      m1 = m2;
      f1 = f2;
      m2 = r - (r - l) / dlt;
      f2 = solve3(q, a, m2);
      res = min(res, f2);
    }
  }
  return res;
}
inline double solve1(const tq &q) {
  double d = sqr(q.a) + sqr(q.b) + sqr(q.c);
  lt = inf;
  rt = -inf;
  for (int i = 0; i < n; i++) {
    double k = (-q.a * p[i].x - q.b * p[i].y - q.c * p[i].z) / d;
    pp[i].x = p[i].x + k * q.a;
    pp[i].y = p[i].y + k * q.b;
    pp[i].z = p[i].z + k * q.c;
    lt = min(lt, pp[i].x);
    lt = min(lt, pp[i].y);
    lt = min(lt, pp[i].z);
    rt = max(rt, pp[i].x);
    rt = max(rt, pp[i].y);
    rt = max(rt, pp[i].z);
  }
  double l = lt;
  double r = rt;
  double m1 = l + (r - l) / dlt;
  double f1 = solve2(q, m1);
  double m2 = r - (r - l) / dlt;
  double f2 = solve2(q, m2);
  double res = min(f1, f2);
  for (int i = 0; i < it; i++) {
    if (f1 < f2) {
      r = m2;
      m2 = m1;
      f2 = f1;
      m1 = l + (r - l) / dlt;
      f1 = solve2(q, m1);
      res = min(res, f1);
    } else {
      l = m1;
      m1 = m2;
      f1 = f2;
      m2 = r - (r - l) / dlt;
      f2 = solve2(q, m2);
      res = min(res, f2);
    }
  }
  res = sqrt(res);
  return res;
}
int main() {
  int m;
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++) {
    scanf("%lf %lf %lf", &p[i].x, &p[i].y, &p[i].z);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lf %lf %lf", &q.a, &q.b, &q.c);
    printf("%.18lf\n", solve1(q));
  }
  return 0;
}