#include <bits/stdc++.h>
using namespace std;
void rint(int &r) { scanf("%d", &r); }
void rInt(long long &r) { scanf("%lld", &r); }
void ruint(unsigned int &r) { scanf("%u", &r); }
void ruInt(unsigned long long &r) { scanf("%llu", &r); }
const int N = 1000, M = 110;
int n, m;
int x[N], y[N], z[N];
double a, b, c;
double xx[N], yy[N];
const double EPS = 1e-12;
namespace std {
bool operator<(const complex<double> &a, const complex<double> &b) {
  return real(a) != real(b) ? real(a) < real(b) : imag(a) < imag(b);
}
}  // namespace std
vector<complex<double> > v;
double calc(double x, double y) {
  double ret = -1.0;
  for (int i = 0; i < (int)(n); ++i)
    ret = max(ret, (xx[i] - x) * (xx[i] - x) + (yy[i] - y) * (yy[i] - y));
  return ret;
}
const double INF = 1.8e+4;
double ternaryY(double x) {
  double left = -INF, right = INF;
  while (right - left > EPS) {
    double leftThird = left + (right - left) * 0.45;
    double rightThird = left + (right - left) * 0.55;
    double rLeft = calc(x, leftThird);
    double rRight = calc(x, rightThird);
    if (rLeft > rRight)
      left = leftThird;
    else
      right = rightThird;
  }
  return (left + right) * 0.5;
}
double largestCoveringCircle() {
  double left = -INF, right = INF;
  while (right - left > EPS) {
    double leftThird = left + (right - left) * 0.45;
    double rightThird = left + (right - left) * 0.55;
    double rLeft = calc(leftThird, ternaryY(leftThird));
    double rRight = calc(rightThird, ternaryY(rightThird));
    if (rLeft > rRight)
      left = leftThird;
    else
      right = rightThird;
  }
  double x = (left + right) * 0.5;
  double y = ternaryY(x);
  return calc(x, y);
}
const double phi = (1 + sqrt(5)) / 2;
const double resphi = (double)2 - phi;
double goldenSectionSearchY(const double X) {
  double a = -INF, b = INF, c = (phi * a + b) / (phi + 1.0);
  double fb = calc(X, b);
  for (;;) {
    if (abs(c - a) < EPS * (abs(b) + abs(c))) break;
    double x;
    if (c - b > b - a)
      x = b + resphi * (c - b);
    else
      x = b - resphi * (b - a);
    double fx = calc(X, x);
    if (fx < fb) {
      if (c - b > b - a)
        a = b, b = x;
      else
        c = b, b = x;
      fb = fx;
    } else {
      if (c - b > b - a)
        c = x;
      else
        a = x;
    }
  }
  return (c + a) / 2;
}
double goldenSectionSearch() {
  double a = -INF, b = INF, c = (phi * a + b) / (phi + 1.0);
  double gb = goldenSectionSearchY(b), fb = calc(b, gb);
  for (;;) {
    if (abs(c - a) < EPS * (abs(b) + abs(c))) break;
    double x;
    if (c - b > b - a)
      x = b + resphi * (c - b);
    else
      x = b - resphi * (b - a);
    double gx = goldenSectionSearchY(x), fx = calc(x, gx);
    if (fx < fb) {
      if (c - b > b - a)
        a = b, b = x;
      else
        c = b, b = x;
      fb = fx;
    } else {
      if (c - b > b - a)
        c = x;
      else
        a = x;
    }
  }
  double x = (c + a) / 2;
  double y = goldenSectionSearchY(x);
  return calc(x, y);
}
void main2();
int main() {
  rint(n);
  rint(m);
  for (int i = 0; i < (int)(n); ++i) {
    rint(x[i]);
    rint(y[i]);
    rint(z[i]);
  }
  for (int i = 0; i < (int)(m); ++i) main2();
  return 0;
}
void main2() {
  scanf("%lf%lf%lf", &a, &b, &c);
  double d = sqrt(a * a + b * b + c * c);
  a /= d;
  b /= d;
  c /= d;
  double x1, y1, z1, x2, y2, z2;
  if (abs(c) < EPS) {
    x1 = b;
    y1 = -a;
    z1 = 0;
  } else {
    x1 = c;
    y1 = 0;
    z1 = -a;
  }
  vector<complex<double> > v;
  x2 = y1 * c - z1 * b;
  y2 = z1 * a - x1 * c;
  z2 = x1 * b - y1 * a;
  double d1 = sqrt(x1 * x1 + y1 * y1 + z1 * z1),
         d2 = sqrt(x2 * x2 + y2 * y2 + z2 * z2);
  x1 /= d1;
  y1 /= d1;
  z1 /= d1;
  x2 /= d2;
  y2 /= d2;
  z2 /= d2;
  for (int i = 0; i < (int)(n); ++i) {
    xx[i] = x1 * x[i] + y1 * y[i] + z1 * z[i];
    yy[i] = x2 * x[i] + y2 * y[i] + z2 * z[i];
  }
  if (n == 1) {
    printf("%.10lf\n", 0.0);
    return;
  }
  double c = goldenSectionSearch();
  printf("%.10lf\n", sqrt(c));
  return;
}
