#include <bits/stdc++.h>
using namespace std;
const int N = 1005;
int n, Q;
struct P3 {
  double x, y, z;
  P3() {}
  P3(double _x, double _y, double _z) {
    x = _x;
    y = _y;
    z = _z;
  }
  void init() { scanf("%lf%lf%lf", &x, &y, &z); }
  double operator*(const P3 &a) const { return x * a.x + y * a.y + z * a.z; }
  P3 operator*(const double &a) const { return P3(x * a, y * a, z * a); }
  P3 operator+(const P3 &a) const { return P3(x + a.x, y + a.y, z + a.z); }
  P3 operator-(const P3 &a) const { return P3(x - a.x, y - a.y, z - a.z); }
  P3 ord() {
    P3 xx = *this;
    return xx * sqrt(1 / (xx * xx));
  }
} P[N];
struct P2 {
  double x, y;
  P2() {}
  P2(double _x, double _y) {
    x = _x;
    y = _y;
  }
  P2 operator+(const P2 &a) const { return P2(x + a.x, y + a.y); }
  P2 operator-(const P2 &a) const { return P2(x - a.x, y - a.y); }
  P2 operator*(const double &a) const { return P2(x * a, y * a); }
  double operator*(const P2 &a) const { return x * a.y - y * a.x; }
  P2 rot() { return P2(y, -x); }
} a[N];
double dis(P2 x, P2 y) {
  return sqrt((x.x - y.x) * (x.x - y.x) + (x.y - y.y) * (x.y - y.y));
}
P2 solve(P3 x, P3 y) {
  y = y - x * ((x * y) / (x * x));
  assert(fabs(y * x) < 1e-9);
  if (fabs(x.x) < 1e-9) swap(x.x, x.y), swap(y.x, y.y);
  if (fabs(x.x) < 1e-9) swap(x.x, x.z), swap(y.x, y.z);
  if (fabs(x.y) < 1e-9 && fabs(x.z) < 1e-9) return P2(y.y, y.z);
  P3 p1(-(x.y * x.y + x.z * x.z) / x.x, x.y, x.z);
  P3 p2(0, x.z, -x.y);
  p1 = p1.ord();
  p2 = p2.ord();
  P2 ans;
  P3 tmp = y;
  ans.y = y.x / p1.x;
  y = y - p1 * ans.y;
  if (fabs(p2.z) > 0)
    ans.x = y.z / p2.z;
  else
    ans.x = y.y / p2.y;
  tmp = tmp - p2 * ans.x;
  tmp = tmp - p1 * ans.y;
  assert(fabs(p1 * x) < 1e-9);
  assert(fabs(p2 * x) < 1e-9);
  assert(fabs(p1 * p2) < 1e-9);
  assert(fabs(p1 * p1 - 1) < 1e-9);
  assert(fabs(p2 * p2 - 1) < 1e-9);
  assert(fabs(tmp.x) < 1e-9);
  assert(fabs(tmp.y) < 1e-9);
  assert(fabs(tmp.z) < 1e-9);
  return ans;
}
P2 Cir(P2 x, P2 y, P2 z) {
  P2 m1 = (x + y) * 0.5, m2 = (x + z) * 0.5;
  P2 d1 = (y - x).rot() + m1, d2 = (z - x).rot() + m2;
  double ar1 = (d1 - m2) * (d2 - m2), ar2 = (d2 - m2) * (m1 - m2);
  if (fabs(ar2) == 0) return m2;
  return m1 + (d1 - m1) * (ar2 / (ar1 + ar2));
}
double min_cir() {
  random_shuffle(a + 1, a + n + 1);
  P2 o = a[1];
  double r = 0;
  for (int i = (int)(1); i <= (int)(n); i++)
    if (dis(o, a[i]) > r + 1e-8) {
      o = a[i], r = 0;
      for (int j = (int)(1); j <= (int)(i - 1); j++)
        if (dis(o, a[j]) > r + 1e-8) {
          o = (a[i] + a[j]) * 0.5;
          r = dis(o, a[j]);
          for (int k = (int)(1); k <= (int)(j - 1); k++)
            if (dis(o, a[k]) > r + 1e-8) {
              o = Cir(a[i], a[j], a[k]), r = dis(o, a[k]);
              double r1 = dis(a[i], o), r2 = dis(a[j], o);
            }
        }
    }
  return r;
}
int main() {
  scanf("%d%d", &n, &Q);
  for (int i = (int)(1); i <= (int)(n); i++) P[i].init();
  while (Q--) {
    P3 x;
    x.init();
    for (int i = (int)(1); i <= (int)(n); i++) a[i] = solve(x, P[i]);
    printf("%.10lf\n", min_cir());
  }
}
