#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
class Pt3d {
 public:
  int x, y, z;
  Pt3d() {}
  Pt3d(int x, int y, int z) {
    this->x = x;
    this->y = y;
    this->z = z;
  }
};
class Pt2d {
 public:
  double x, y;
  Pt2d() {}
  Pt2d(double x, double y, int t = -1) {
    this->x = x;
    this->y = y;
  }
  void operator=(const Pt2d &pt2) {
    this->x = pt2.x;
    this->y = pt2.y;
  }
  friend bool operator==(const Pt2d &pt1, const Pt2d &pt2) {
    return fabs(pt1.x - pt2.x) < eps && fabs(pt1.y - pt2.y) < eps;
  }
  friend bool operator!=(const Pt2d &pt1, const Pt2d &pt2) {
    return fabs(pt1.x - pt2.x) > eps && fabs(pt1.y - pt2.y) > eps;
  }
};
struct MyLine {
  double A, B, C;
  MyLine() {}
};
int n, m;
Pt3d pt3[900];
Pt2d pt[900];
Pt2d rCenter;
double r = 0.0;
unsigned int ptR[4];
unsigned int ptRSize = 0;
void init() {
  scanf("%d %d", &n, &m);
  for (int i = 0; i < n; ++i)
    scanf("%d %d %d", &pt3[i].x, &pt3[i].y, &pt3[i].z);
}
double lenPt2(Pt2d &pt1, Pt2d &pt2) {
  return sqrt(pow(pt1.x - pt2.x, 2.0) + pow(pt1.y - pt2.y, 2.0));
}
Pt2d centerPt2(const Pt2d &pt1, const Pt2d &pt2) {
  return Pt2d((pt1.x + pt2.x) / 2, (pt1.y + pt2.y) / 2);
}
void calcLine(Pt2d pt2d, MyLine &myline) {
  myline.C = -pt2d.x * myline.A - pt2d.y * myline.B;
}
Pt2d centerCircle(const Pt2d &pt1, const Pt2d &pt2) {
  return Pt2d((pt1.x + pt2.x) / 2, (pt1.y + pt2.y) / 2);
}
Pt2d centerCircle(const Pt2d &pt1, const Pt2d &pt2, const Pt2d &pt3) {
  Pt2d res;
  MyLine myline[2];
  myline[0].A = pt1.x - pt2.x;
  myline[0].B = pt1.y - pt2.y;
  calcLine(centerPt2(pt1, pt2), myline[0]);
  myline[1].A = pt1.x - pt3.x;
  myline[1].B = pt1.y - pt3.y;
  calcLine(centerPt2(pt1, pt3), myline[1]);
  double d = (myline[0].A * myline[1].B - myline[1].A * myline[0].B);
  res.x = (-myline[0].C * myline[1].B + myline[1].C * myline[0].B) / d;
  res.y = (-myline[0].A * myline[1].C + myline[1].A * myline[0].C) / d;
  return res;
}
bool isOneLine(const Pt2d &pt1, const Pt2d &pt2, const Pt2d &pt3) {
  return (pt3.x - pt1.x) * (pt2.y - pt1.y) == (pt3.y - pt1.y) * (pt2.x - pt1.x);
}
bool isNotEqual(const Pt2d &pt1, const Pt2d &pt2, const Pt2d &pt3) {
  return pt1 != pt2 && pt2 != pt3;
}
void createCircle() {
  Pt2d *superPt = &pt[ptR[ptRSize - 1]];
  unsigned int arr[2] = {111111, 111111};
  bool flag = true;
  bool resizeR = false;
  for (unsigned int i = 0; i < ptRSize - 1; ++i) {
    Pt2d newRCenter = centerCircle(pt[ptR[i]], *superPt);
    double newR = lenPt2(newRCenter, pt[ptR[i]]);
    if (resizeR && newR > r) continue;
    bool isRightCircle = true;
    for (unsigned int j = 0; j < ptRSize - 1; ++j)
      if (j != i) {
        double d = lenPt2(newRCenter, pt[ptR[j]]);
        if (d > newR + eps) {
          isRightCircle = false;
          break;
        }
      }
    if (isRightCircle) {
      arr[0] = ptR[i];
      r = newR;
      rCenter = newRCenter;
      resizeR = true;
    }
  }
  if (resizeR) {
    ptR[0] = arr[0];
    ptR[1] = ptR[ptRSize - 1];
    ptR[2] = 1111111;
    ptR[3] = 1111111;
    ptRSize = 2;
    rCenter = centerCircle(pt[ptR[0]], pt[ptR[1]]);
    r = lenPt2(rCenter, pt[ptR[0]]);
    return;
  }
  arr[0] = 111111;
  flag = true;
  resizeR = false;
  for (unsigned int i = 0; i < ptRSize - 2; ++i)
    for (unsigned int j = i + 1; j < ptRSize - 1; ++j)
      if (!isOneLine(pt[ptR[i]], pt[ptR[j]], *superPt)) {
        Pt2d newRCenter = centerCircle(*superPt, pt[ptR[i]], pt[ptR[j]]);
        double newR = lenPt2(newRCenter, *superPt);
        if (resizeR && newR > r) continue;
        flag = true;
        for (unsigned int k = 0; k < ptRSize - 1; ++k)
          if (k != i && k != j) {
            double d = lenPt2(newRCenter, pt[ptR[k]]);
            if (d > newR + eps) {
              flag = false;
              break;
            }
          }
        if (flag) {
          rCenter = newRCenter;
          r = newR;
          arr[0] = ptR[i];
          arr[1] = ptR[j];
          resizeR = true;
        }
      }
  ptR[0] = arr[0];
  ptR[1] = arr[1];
  ptR[2] = ptR[ptRSize - 1];
  ptR[3] = 1111111;
  ptRSize = 3;
  rCenter = centerCircle(pt[ptR[0]], pt[ptR[1]], pt[ptR[2]]);
  r = lenPt2(rCenter, pt[ptR[0]]);
}
bool isOutsideCircle(unsigned int &id) {
  return lenPt2(rCenter, pt[id]) > r + eps;
}
void calcNewR(unsigned int id) {
  ptR[ptRSize] = id;
  ++ptRSize;
  createCircle();
  bool flag = true;
  while (flag) {
    flag = false;
    for (unsigned int i = 0; i < id; ++i)
      if (i != ptR[0] && i != ptR[1] && i != ptR[2] && i != ptR[3]) {
        if (lenPt2(rCenter, pt[i]) > r + eps) {
          ptR[ptRSize] = i;
          ++ptRSize;
          createCircle();
          flag = true;
          break;
        }
      }
  }
}
double calcR() {
  if (n == 1) return 0;
  ptRSize = 2;
  ptR[0] = 0;
  ptR[1] = 1;
  ptR[2] = 100000;
  ptR[3] = 100000;
  rCenter = centerPt2(pt[ptR[0]], pt[ptR[1]]);
  r = lenPt2(pt[ptR[0]], rCenter);
  for (int j = 2; j < n; ++j)
    if (lenPt2(rCenter, pt[j]) > r + eps) {
      calcNewR(j);
    }
  return r;
}
Pt2d calcPt2d(int &A, int &B, int &C, Pt3d &pt3d) {
  if (A == 0 && B == 0) return Pt2d(pt3d.x, pt3d.y);
  if (B == 0 && C == 0) return Pt2d(pt3d.y, pt3d.z);
  if (C == 0 && A == 0) return Pt2d(pt3d.z, pt3d.x);
  double t =
      -(A * pt3d.x + B * pt3d.y + C * pt3d.z) / (double)(A * A + B * B + C * C);
  double x = pt3d.x + t * A, y = pt3d.y + t * B, z = pt3d.z + 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 Pt2d(0, 0);
  double ang = acos((aa * aa + bb * bb - cc * cc) / (2 * aa * bb));
  if (x < 0) ang = -ang;
  return Pt2d(aa * cos(ang), aa * sin(ang));
}
int main() {
  init();
  for (int i = 0; i < m; ++i) {
    int A, B, C;
    scanf("%d %d %d", &A, &B, &C);
    for (unsigned int j = 0; j < (unsigned int)n; ++j) {
      pt[j] = calcPt2d(A, B, C, pt3[j]);
    }
    printf("%.7f\n", calcR());
  }
  return 0;
}
