#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:65777216")
using namespace std;
int n, m;
int x[999], y[999], z[999];
pair<double, double> p[999];
pair<double, double> PP(int a, int b, int c, int d, int e, int f) {
  if (a == 0 && b == 0) return pair<double, double>(d, e);
  if (b == 0 && c == 0) return pair<double, double>(e, f);
  if (c == 0 && a == 0) return pair<double, double>(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(0. + x * x + y * y + z * z), bb = sqrt(0. + b * b + c * c),
         cc = sqrt(0. + x * x + (c + y) * (c + y) + (z - b) * (z - b));
  if (fabs(aa) < 1e-9) return pair<double, double>(0, 0);
  double ang = acos((aa * aa + bb * bb - cc * cc) / (2 * aa * bb));
  if (x < 0) ang = -ang;
  return pair<double, double>(aa * cos(ang), aa * sin(ang));
}
double DIST(pair<double, double> p, pair<double, double> c) {
  return (p.first - c.first) * (p.first - c.first) +
         (p.second - c.second) * (p.second - c.second);
}
bool good(double R) {
  double RR = R * R;
  pair<double, double> c = p[0];
  for (int i = 1; i < n; i++) {
    double dist = DIST(p[i], c);
    if (dist > RR + 1e-6) {
      bool found = 0;
      for (int j(0); j < (i); j++) {
        double D = DIST(p[i], p[j]);
        if (D > 4 * RR + 1e-6) return 0;
        double x = p[i].first + p[j].first;
        x /= 2;
        double y = p[i].second + p[j].second;
        y /= 2;
        double vx = p[i].first - p[j].first;
        double vy = p[i].second - p[j].second;
        double k = sqrt((RR - D / 4) / (vx * vx + vy * vy));
        vx *= k, vy *= k;
        swap(vx, vy);
        vx *= (-1);
        for (int d(0); d < (2); d++) {
          double X = x + (d ? vx : -vx);
          double Y = y + (d ? vy : -vy);
          pair<double, double> t(X, Y);
          bool gd = true;
          for (int k(0); k < (i); k++)
            if (DIST(p[k], t) > RR + 1e-6) {
              gd = 0;
              break;
            }
          if (gd) {
            c = t;
            found = true;
            break;
          }
        }
        if (found) break;
      }
      if (!found) return 0;
    }
  }
  return 1;
}
double solve() {
  random_shuffle(p, p + n);
  double a = 0;
  double b = 1e5;
  for (int i(0); i < (50); i++) {
    double s = (a + b) / 2;
    if (good(s))
      b = s;
    else
      a = s;
  }
  return a;
}
int main() {
  cin >> n >> m;
  for (int i(0); i < (n); i++) scanf("%d %d %d", x + i, y + i, z + i);
  for (int i(0); i < (m); i++) {
    int X, Y, Z;
    scanf("%d %d %d", &X, &Y, &Z);
    for (int j(0); j < (n); j++) p[j] = PP(X, Y, Z, x[j], y[j], z[j]);
    printf("%.10lf\n", solve());
  }
  return 0;
}
