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-8, inf = 1e+9, pi = acos(-1.0);
inline int sign(double x) { return x < -eps ? -1 : x > eps; }
inline double sqr(double x) { return x * x; }
struct point {
  double x, y;
  point(double x = 0, double y = 0) : x(x), y(y) {}
  bool operator<(const point &p) const {
    return sign(x - p.x) * 2 + sign(y - p.y) < 0;
  }
  bool operator==(const point &p) const {
    return !sign(x - p.x) && !sign(y - p.y);
  }
};
void read(point *p) { scanf("%lf %lf", &p->x, &p->y); }
void print(point p) { printf("%.3lf %.3lf\n", p.x, p.y); }
point operator-(point a, point b) {
  a.x -= b.x;
  a.y -= b.y;
  return a;
}
double cross(point a, point b, point c) {
  return (b.x - a.x) * (c.y - b.y) - (b.y - a.y) * (c.x - b.x);
}
double dist(point a, point b) { return hypot(a.x - b.x, a.y - b.y); }
point mp(point a, point b) { return point((a.x + b.x) / 2, (a.y + b.y) / 2); }
point np(point a, double alpha, double d) {
  return point(a.x + d * cos(alpha), a.y + d * sin(alpha));
}
double dot(point p, point a, point b) {
  return (a.x - p.x) * (b.x - p.x) + (a.y - p.y) * (b.y - p.y);
}
inline double delta_angle(point a, point b, point c) {
  return acos(dot(b, a, c) / (dist(a, b) * dist(b, c)));
}
int sharp(point a, point b, point c) {
  return sign(dot(a, b, c)) > 0 && sign(dot(b, a, c)) > 0 &&
         sign(dot(c, a, b)) > 0;
}
double fix(double a, double b = 0) {
  a -= b;
  if (sign(a) < 0) a += 2 * pi;
  if (sign(a - 2 * pi) >= 0) a -= 2 * pi;
  return a;
}
double angle(point a, point b) { return fix(atan2(b.y - a.y, b.x - a.x)); }
point rotate(point a, point b, double alpha) {
  double s, c, x, y;
  a.x -= b.x;
  a.y -= b.y;
  c = cos(alpha);
  s = sin(alpha);
  x = a.x * c - a.y * s;
  y = a.x * s + a.y * c;
  a.x = x + b.x;
  a.y = y + b.y;
  return a;
}
double area_heron(double a, double b, double c) {
  double s = (a + b + c) / 2.0;
  if (a > s || b > s || c > s) return -1;
  return sqrt(s * (s - a) * (s - b) * (s - c));
}
double area_triangle(point a, point b, point c) {
  return fabs(a.x * b.y + b.x * c.y + c.x * a.y - a.x * c.y - b.x * a.y -
              c.x * b.y) /
         2;
}
double area_polygon(point a[], int n) {
  double area = 0;
  for (int j = 0, i = n - 1; j < n; i = j++)
    area += a[i].x * a[j].y - a[i].y * a[j].x;
  return fabs(area) / 2;
}
point centroid(point a[], int n) {
  double area = 0;
  point c;
  for (int i = 0; i < n; i++) {
    int j = (i + 1) % n;
    area += a[i].x * a[j].y - a[i].y * a[j].x;
    c.x += (a[i].x + a[j].x) * (a[i].x * a[j].y - a[i].y * a[j].x);
    c.y += (a[i].y + a[j].y) * (a[i].x * a[j].y - a[i].y * a[j].x);
  }
  area = fabs(area) / 2;
  c.x /= 6 * area;
  c.y /= 6 * area;
  return c;
}
point __o;
bool acmp(point a, point b) {
  int c = sign(cross(__o, a, b));
  return c > 0 || !c && dist(a, __o) < dist(b, __o);
}
int find_convex(point p[], int n) {
  __o = *min_element(p, p + n);
  sort(p, p + n, acmp);
  int top = 0;
  point *stack = (point *)malloc(n * sizeof(point));
  for (int i = 0; i < n; i++) {
    while (top >= 2 && sign(cross(stack[top - 2], stack[top - 1], p[i])) <= 0)
      top--;
    stack[top++] = p[i];
  }
  copy(stack, stack + top, p);
  free(stack);
  return top;
}
double shadow_length(double alpha, point a, point b) {
  double dx = a.x - b.x;
  double dy = a.y - b.y;
  double c = cos(alpha);
  double s = sin(alpha);
  return fabs(dx * c + dy * s);
}
void rotate_calipers(point ps[], int n, double &area, double &peri) {
  area = peri = inf;
  n = find_convex(ps, n);
  ps[n] = ps[0];
  point *q[4] = {NULL, NULL, NULL, NULL};
  for (int i = 0; i < n; i++) {
    point *p = &ps[i];
    if (!q[0] || q[0]->y > p->y || q[0]->y == p->y && q[0]->x > p->x) q[0] = p;
    if (!q[1] || q[1]->x < p->x || q[1]->x == p->x && q[1]->y > p->y) q[1] = p;
    if (!q[2] || q[2]->y < p->y || q[2]->y == p->y && q[2]->x < p->x) q[2] = p;
    if (!q[3] || q[3]->x > p->x || q[3]->x == p->x && q[3]->y < p->y) q[3] = p;
  }
  double alpha = 0;
  for (int k = 0; k < n + 5; k++) {
    int bi = -1;
    double gap_min = inf;
    for (int i = 0; i < 4; i++) {
      double gap = fix(angle(q[i][0], q[i][1]), alpha + i * pi / 2);
      if (gap < gap_min) {
        gap_min = gap;
        bi = i;
      }
    }
    if (++q[bi] == ps + n) q[bi] = ps + 0;
    alpha = fix(alpha + gap_min);
    double a = shadow_length(alpha + pi / 2, *q[0], *q[2]);
    double b = shadow_length(alpha, *q[1], *q[3]);
    area = min(area, a * b);
    peri = min(peri, a + a + b + b);
  }
}
struct line {
  point p, q;
  line() {}
  line(point p, point q) : p(p), q(q) {}
};
int parallel(line u, line v) {
  return !sign((u.p.x - u.q.x) * (v.p.y - v.q.y) -
               (v.p.x - v.q.x) * (u.p.y - u.q.y));
}
int side(line m, point p, point q) {
  return sign(cross(m.p, m.q, p)) * sign(cross(m.p, m.q, q));
}
int on_line(line l, point p) { return !sign(cross(l.p, l.q, p)); }
int coinside(line u, line v) { return on_line(u, v.p) && on_line(u, v.q); }
int intersected(line u, line v) {
  return !parallel(u, v) && side(u, v.p, v.q) <= 0 && side(v, u.p, u.q) <= 0;
}
int intersected_exclusive(line u, line v) {
  return !parallel(u, v) && side(u, v.p, v.q) < 0 && side(v, u.p, u.q) < 0;
}
point ip(line u, line v) {
  double n =
      (u.p.y - v.p.y) * (v.q.x - v.p.x) - (u.p.x - v.p.x) * (v.q.y - v.p.y);
  double d =
      (u.q.x - u.p.x) * (v.q.y - v.p.y) - (u.q.y - u.p.y) * (v.q.x - v.p.x);
  double r = n / d;
  return point(u.p.x + r * (u.q.x - u.p.x), u.p.y + r * (u.q.y - u.p.y));
}
int on_lineseg(line l, point P) {
  return on_line(l, P) && sign(dot(P, l.p, l.q)) <= 0;
}
int on_lineseg_exclusive(line l, point P) {
  return on_line(l, P) && sign(dot(P, l.p, l.q)) < 0;
}
double dist_line_point(line l, point a) {
  return fabs(cross(l.p, l.q, a)) / dist(l.p, l.q);
}
double dist_lineseg_point(line l, point a) {
  if (on_lineseg(l, a)) return 0;
  if (on_line(l, a) || !sharp(l.p, a, l.q))
    return min(dist(l.p, a), dist(l.q, a));
  return dist_line_point(l, a);
}
int intersected_lineseg_ray(line u, line v, point &p) {
  if (parallel(u, v)) return 0;
  p = ip(u, v);
  return on_lineseg(u, p) &&
         (on_lineseg(v, p) || on_lineseg(line(v.p, p), v.q));
}
int inside_polygon(point p[], int n, point a) {
  double sum = 0;
  for (int i = 0; i < n; i++) {
    int j = (i + 1) % n;
    if (on_lineseg(line(p[i], p[j]), a)) return 0;
    double angle = acos(dot(a, p[i], p[j]) / dist(a, p[i]) / dist(a, p[j]));
    sum += sign(cross(a, p[i], p[j])) * angle;
  }
  return sign(sum);
}
int lineseg_inside_polygon(point p[], int n, line l) {
  for (int i = 0; i < n; i++) {
    int j = (i + 1) % n;
    line l1(p[i], p[j]);
    if (on_lineseg_exclusive(l, p[i])) return 0;
    if (intersected_exclusive(l, l1)) return 0;
  }
  return inside_polygon(p, n, mp(l.p, l.q));
}
int intersect_convex_lineseg(point p[], int n, line l) {
  if (n < 3) return 0;
  point q[4];
  int k = 0;
  q[k++] = l.p;
  q[k++] = l.q;
  for (int i = 0; i < n; i++) {
    if (on_lineseg(l, p[i])) {
      q[k++] = p[i];
    } else {
      int j = (i + 1) % n;
      line a(p[i], p[j]);
      point X = ip(a, l);
      if (on_lineseg(l, X) && on_lineseg(a, X)) q[k++] = X;
    }
  }
  sort(q, q + k);
  for (int i = 0; i + 1 < k; i++) {
    if (inside_polygon(p, n, mp(q[i], q[i + 1]))) return 1;
  }
  return 0;
}
line perpendicular(line l, point a) {
  return line(a, point(a.x + l.p.y - l.q.y, a.y + l.q.x - l.p.x));
}
point pedal(line l, point a) { return ip(l, perpendicular(l, a)); }
point mirror(line l, point a) {
  point p = pedal(l, a);
  return point(p.x * 2 - a.x, p.y * 2 - a.y);
}
point perpencenter(point a, point b, point c) {
  line u = perpendicular(line(b, c), a);
  line v = perpendicular(line(a, c), b);
  return ip(u, v);
}
point icc(point A, point B, point C) {
  double a = dist(B, C), b = dist(C, A), c = dist(A, B), p = (a + b + c) / 2,
         s = sqrt(p * (p - a) * (p - b) * (p - c));
  point cp;
  cp.x = (a * A.x + b * B.x + c * C.x) / (a + b + c);
  cp.y = (a * A.y + b * B.y + c * C.y) / (a + b + c);
  return cp;
}
line pb(point a, point b) { return perpendicular(line(a, b), mp(a, b)); }
point ccc(point A, point B, point C) {
  double a1 = B.x - A.x, b1 = B.y - A.y, c1 = (sqr(a1) + sqr(b1)) / 2;
  double a2 = C.x - A.x, b2 = C.y - A.y, c2 = (sqr(a2) + sqr(b2)) / 2;
  double d = a1 * b2 - a2 * b1;
  point cp;
  cp.x = A.x + (c1 * b2 - c2 * b1) / d;
  cp.y = A.y + (a1 * c2 - a2 * c1) / d;
  return cp;
}
line translate(line l, double e, int s) {
  double d = dist(l.p, l.q);
  double x = l.p.y - l.q.y;
  double y = l.q.x - l.p.x;
  x *= s * e / d;
  y *= s * e / d;
  l.p.x += x;
  l.p.y += y;
  l.q.x += x;
  l.q.y += y;
  return l;
}
bool lcmp(line u, line v) {
  int c = sign((u.p.x - u.q.x) * (v.p.y - v.q.y) -
               (v.p.x - v.q.x) * (u.p.y - u.q.y));
  return c < 0 || !c && sign(cross(u.p, u.q, v.p)) < 0;
}
int ip_convex(line l[], int n, point p[]) {
  for (int i = 0; i < n; i++)
    if (l[i].q < l[i].p) swap(l[i].p, l[i].q);
  sort(l, l + n, lcmp);
  int n1 = 0;
  for (int i = 0, j = 0; i < n; i = j) {
    while (j < n && parallel(l[i], l[j])) j++;
    if (j - i == 1) {
      l[n1++] = l[i];
    } else {
      l[n1++] = l[i];
      l[n1++] = l[j - 1];
    }
  }
  n = n1;
  l[n + 0] = l[0];
  l[n + 1] = l[1];
  int m = 0;
  for (int i = 0, j = 0; i < n; i++) {
    while (j < n + 2 && parallel(l[i], l[j])) j++;
    for (int k = j; k < n + 2 && parallel(l[j], l[k]); k++)
      p[m++] = ip(l[i], l[k]);
  }
  return find_convex(p, m);
}
struct circle {
  point o;
  double r;
  circle(point o = point(), double r = 1) : o(o), r(r) {}
  circle(double x, double y, double r = 1) : o(x, y), r(r) {}
};
int intersected_circle_line(circle c, line l) {
  return sign(dist_line_point(l, c.o) - c.r) < 0;
}
int ip_circle_line(circle c, line l, point &p1, point &p2) {
  point a = l.p, b = l.q;
  double dx = b.x - a.x, dy = b.y - a.y;
  double sdr = sqr(dx) + sqr(dy), dr = sqrt(sdr);
  double d, disc, x, y;
  a.x -= c.o.x;
  a.y -= c.o.y;
  b.x -= c.o.x;
  b.y -= c.o.y;
  d = a.x * b.y - b.x * a.y;
  disc = sqr(c.r) * sdr - sqr(d);
  if (disc < -eps) return 0;
  if (disc < +eps)
    disc = 0;
  else
    disc = sqrt(disc);
  x = disc * dx * (dy > 0 ? 1 : -1);
  y = disc * fabs(dy);
  p1.x = (+d * dy + x) / sdr + c.o.x;
  p2.x = (+d * dy - x) / sdr + c.o.x;
  p1.y = (-d * dx + y) / sdr + c.o.y;
  p2.y = (-d * dx - y) / sdr + c.o.y;
  return disc > eps ? 2 : 1;
}
int ip_circle_circle(const circle &c1, const circle &c2, point &p1, point &p2) {
  double mx = c2.o.x - c1.o.x, sx = c2.o.x + c1.o.x, mx2 = sqr(mx);
  double my = c2.o.y - c1.o.y, sy = c2.o.y + c1.o.y, my2 = sqr(my);
  double sq = mx2 + my2, d = -(sq - sqr(c1.r - c2.r)) * (sq - sqr(c1.r + c2.r));
  if (!sign(sq)) return 0;
  if (d + eps < 0) return 0;
  if (d < eps)
    d = 0;
  else
    d = sqrt(d);
  double x = mx * ((c1.r + c2.r) * (c1.r - c2.r) + mx * sx) + sx * my2;
  double y = my * ((c1.r + c2.r) * (c1.r - c2.r) + my * sy) + sy * mx2;
  double dx = mx * d, dy = my * d;
  sq *= 2;
  p1.x = (x + dy) / sq;
  p1.y = (y - dx) / sq;
  p2.x = (x - dy) / sq;
  p2.y = (y + dx) / sq;
  return d > eps ? 2 : 1;
}
double circle_circle_intersection_area(circle A, circle B) {
  double d, dA, dB, tx, ty;
  d = hypot(B.o.x - A.o.x, B.o.y - A.o.y);
  if ((d < eps) || (d + A.r <= B.r) || (d + B.r <= A.r))
    return sqr((B.r < A.r) ? B.r : A.r) * pi;
  if (d >= A.r + B.r) return 0;
  dA = tx = (sqr(d) + sqr(A.r) - sqr(B.r)) / d / 2;
  ty = sqrt(sqr(A.r) - sqr(tx));
  dB = d - dA;
  return sqr(A.r) * acos(dA / A.r) - dA * sqrt(sqr(A.r) - sqr(dA)) +
         sqr(B.r) * acos(dB / B.r) - dB * sqrt(sqr(B.r) - sqr(dB));
}
void circle_tangents(circle c, point p, point &a, point &b) {
  double d = sqr(c.o.x - p.x) + sqr(c.o.y - p.y);
  double para = sqr(c.r) / d;
  double perp = c.r * sqrt(d - sqr(c.r)) / d;
  a.x = c.o.x + (p.x - c.o.x) * para - (p.y - c.o.y) * perp;
  a.y = c.o.y + (p.y - c.o.y) * para + (p.x - c.o.x) * perp;
  b.x = c.o.x + (p.x - c.o.x) * para + (p.y - c.o.y) * perp;
  b.y = c.o.y + (p.y - c.o.y) * para - (p.x - c.o.x) * perp;
}
int on_circle(circle c, point a) { return sign(c.r - dist(a, c.o)); }
circle cc2(point a, point b) { return circle(mp(a, b), dist(a, b) / 2); }
circle cc3(point p, point q, point r) {
  circle c;
  if (on_circle(c = cc2(p, q), r) >= 0) return c;
  if (on_circle(c = cc2(p, r), q) >= 0) return c;
  if (on_circle(c = cc2(q, r), p) >= 0) return c;
  c.o = ccc(p, q, r);
  c.r = dist(c.o, p);
  return c;
}
circle min_circle_cover(point p[], int n) {
  if (n == 1) return circle(p[0], 0);
  if (n == 2) return cc2(p[0], p[1]);
  random_shuffle(p, p + n);
  point *ps[4] = {&p[0], &p[1], &p[2], &p[3]};
  circle c = cc3(*ps[0], *ps[1], *ps[2]);
  while (1) {
    point *b = p;
    for (int i = 1; i < n; i++)
      if (dist(p[i], c.o) > dist(*b, c.o)) b = &p[i];
    if (on_circle(c, *b) >= 0) return c;
    ps[3] = b;
    for (int i = 0; i < 3; i++) {
      swap(ps[i], ps[3]);
      if (on_circle(c = cc3(*ps[0], *ps[1], *ps[2]), *ps[3]) >= 0) break;
    }
  }
}
typedef struct pt {
  double x, y, z;
} vt;
inline vt operator+(pt a, pt b) {
  a.x += b.x;
  a.y += b.y;
  a.z += b.z;
  return a;
}
inline vt operator-(pt a, pt b) {
  a.x -= b.x;
  a.y -= b.y;
  a.z -= b.z;
  return a;
}
inline vt operator*(double t, vt a) {
  a.x *= t;
  a.y *= t;
  a.z *= t;
  return a;
}
inline vt operator*(vt a, double t) {
  a.x *= t;
  a.y *= t;
  a.z *= t;
  return a;
}
inline vt operator/(vt a, double t) {
  a.x /= t;
  a.y /= t;
  a.z /= t;
  return a;
}
inline vt operator*(vt a, vt b) {
  vt c;
  c.x = a.y * b.z - a.z * b.y;
  c.y = a.z * b.x - a.x * b.z;
  c.z = a.x * b.y - a.y * b.x;
  return c;
}
inline double operator^(vt a, vt b) {
  return a.x * b.x + a.y * b.y + a.z * b.z;
}
inline double len(vt a) { return sqrt(a ^ a); }
inline int zero(vt a) { return !sign(a.x) && !sign(a.y) && !sign(a.z); }
inline double frand() { return rand() / (RAND_MAX + 1.0); }
vt perp_vt(vt u) {
  vt v, n;
  while (1) {
    v.x = frand();
    v.y = frand();
    v.z = frand();
    if (!zero(n = u * v)) return n;
  }
}
const int N = 1024;
int n, m;
pt ps[N];
point qs[N];
int main() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; i++)
    scanf("%lf %lf %lf", &ps[i].x, &ps[i].y, &ps[i].z);
  while (m--) {
    vt norm, xdir, ydir;
    scanf("%lf %lf %lf", &norm.x, &norm.y, &norm.z);
    norm = norm / len(norm);
    xdir = perp_vt(norm);
    xdir = xdir / len(xdir);
    ydir = norm * xdir;
    for (int i = 0; i < n; i++) {
      qs[i].x = ps[i] ^ xdir;
      qs[i].y = ps[i] ^ ydir;
    }
    sort(qs, qs + n);
    int n1 = unique(qs, qs + n) - qs;
    printf("%.10lf\n", min_circle_cover(qs, n1).r);
  }
  return 0;
}