#include <bits/stdc++.h>
using namespace std;
const double pi = acos(-1.0);
const double eps = 1E-7;
const int inf = 123456789;
int sgn(double x) {
  if (x < -eps) return -1;
  if (x > eps) return 1;
  return 0;
}
struct Point {
  double x, y;
  Point(double _x, double _y) : x(_x), y(_y) {}
  Point() {}
};
struct Seg {
  Point p0, p1;
  Seg(Point _p0, Point _p1) : p0(_p0), p1(_p1) {}
  Seg() {}
};
struct Circle {
  Point o;
  double r;
  Circle() {}
  Circle(Point _o, double _r) : o(_o), r(_r) {}
};
inline Point operator+(const Point &p1, const Point &p2) {
  return Point(p1.x + p2.x, p1.y + p2.y);
}
inline Point operator-(const Point &p1, const Point &p2) {
  return Point(p1.x - p2.x, p1.y - p2.y);
}
inline Point operator*(const Point &p, double k) {
  return Point(p.x * k, p.y * k);
}
inline double operator^(const Point &p1, const Point &p2) {
  return (p1.x * p2.y - p2.x * p1.y);
}
inline double operator*(const Point &p1, const Point &p2) {
  return p1.x * p2.x + p1.y * p2.y;
}
inline double cross(Point p0, Point p1, Point p2) {
  return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
}
inline double get_dis(const Point &p1, const Point &p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
}
inline bool getC(Point p0, Point p1, Point p2, Point &p) {
  if (sgn(cross(p0, p1, p2)) == 0) return false;
  double a = p1.x - p0.x;
  double b = p1.y - p0.y;
  double c = 0.5 * (((p1.x) * (p1.x)) + ((p1.y) * (p1.y)) - ((p0.x) * (p0.x)) -
                    ((p0.y) * (p0.y)));
  double d = p2.x - p0.x;
  double e = p2.y - p0.y;
  double f = 0.5 * (((p2.x) * (p2.x)) + ((p2.y) * (p2.y)) - ((p0.x) * (p0.x)) -
                    ((p0.y) * (p0.y)));
  p = Point((c * e - f * b) / (a * e - b * d),
            (c * d - f * a) / (b * d - e * a));
  return true;
}
Point projection(double a, double b, double c, double d, double e, double f) {
  if (sgn(a) == 0 && sgn(b) == 0) return Point(d, e);
  if (sgn(b) == 0 && sgn(c) == 0) return Point(e, f);
  if (sgn(c) == 0 && sgn(a) == 0) return Point(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 Point(0, 0);
  double ang = acos((aa * aa + bb * bb - cc * cc) / (2 * aa * bb));
  if (x < 0) ang = -ang;
  return Point(aa * cos(ang), aa * sin(ang));
}
double min_circle_cover(Point *pa, int n) {
  random_shuffle(pa, pa + n);
  Point o(0, 0);
  double R = 0;
  for (int(i) = (1); (i) < (n); ++(i))
    if (get_dis(o, pa[i]) > R + eps) {
      o = pa[i];
      R = 0;
      for (int(j) = 0; (j) < (i); ++(j))
        if (get_dis(o, pa[j]) > R + eps) {
          o = (pa[i] + pa[j]) * 0.5;
          R = get_dis(o, pa[i]);
          for (int(k) = 0; (k) < (j); ++(k))
            if (get_dis(o, pa[k]) > R + eps) {
              getC(pa[i], pa[j], pa[k], o);
              R = get_dis(o, pa[i]);
            }
        }
    }
  return R;
}
const int maxN = 1000 + 5;
int xs[maxN], ys[maxN], zs[maxN];
Point pa[maxN];
int n, m;
int main() {
  scanf("%d%d", &n, &m);
  for (int(i) = 0; (i) < (n); ++(i)) scanf("%d%d%d", xs + i, ys + i, zs + i);
  for (int(r) = 0; (r) < (m); ++(r)) {
    int a, b, c;
    scanf("%d%d%d", &a, &b, &c);
    for (int(i) = 0; (i) < (n); ++(i)) {
      pa[i] = projection(a, b, c, xs[i], ys[i], zs[i]);
    }
    printf("%.8lf\n", min_circle_cover(pa, n));
  }
  return 0;
}
