#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;
  }
  ~Pt3d(){};
};
class Pt2d {
 public:
  double x, y;
  int Tang;
  Pt2d() {}
  Pt2d(double x, double y, int t = -1) {
    this->x = x;
    this->y = y;
    Tang = t;
  }
  void operator=(const Pt2d &pt2) {
    this->x = pt2.x;
    this->y = pt2.y;
    this->Tang = pt2.Tang;
  }
  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;
  }
};
int n, m;
Pt3d pt3[1000];
Pt2d pt[1000];
Pt2d rCenter;
double r = 0.0;
int idMPt[2] = {0, 1};
std::vector<Pt2d> ptR;
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) {
  Pt2d res;
  res.x = (pt1.x + pt2.x) / 2;
  res.y = (pt1.y + pt2.y) / 2;
  return res;
}
struct MyLine {
  double A, B, C;
  MyLine() {}
};
void calcLine(Pt2d pt2d, MyLine &myline) {
  myline.C = -pt2d.x * myline.A - pt2d.y * myline.B;
}
Pt2d calcRCenter(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]);
  res.x = (-myline[0].C * myline[1].B + myline[1].C * myline[0].B) /
          (myline[0].A * myline[1].B - myline[1].A * myline[0].B);
  res.y = (-myline[0].A * myline[1].C + myline[1].A * myline[0].C) /
          (myline[0].A * myline[1].B - myline[1].A * myline[0].B);
  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 newRCenter;
  vector<Pt2d> resvec;
  resvec.push_back(ptR[ptR.size() - 1]);
  bool flag = false;
  bool resizeR = false;
  double newR;
  unsigned int superPt = 1111111;
  for (unsigned int i = 0; i < ptR.size() - 1; ++i) {
    newRCenter = centerPt2(resvec[0], ptR[i]);
    newR = lenPt2(newRCenter, resvec[0]);
    if (resizeR && newR > r) continue;
    flag = true;
    for (unsigned int j = 0; j < ptR.size() - 1; ++j)
      if (j != i) {
        double d = lenPt2(newRCenter, ptR[j]);
        if (d > newR + eps) {
          flag = false;
          break;
        }
      }
    if (flag) {
      superPt = i;
      r = newR;
      rCenter = newRCenter;
      resizeR = true;
    }
  }
  if (resizeR) {
    resvec.push_back(ptR[superPt]);
    ptR = resvec;
    return;
  }
  unsigned int arr[2] = {111111, 111111};
  resizeR = false;
  for (unsigned int i = 0; i < ptR.size(); ++i)
    for (unsigned int j = i + 1; j < ptR.size(); ++j)
      if (!isOneLine(ptR[i], ptR[j], resvec[0])) {
        newRCenter = calcRCenter(resvec[0], ptR[i], ptR[j]);
        newR = lenPt2(newRCenter, resvec[0]);
        if (resizeR && newR > r) continue;
        flag = true;
        for (unsigned int k = 0; k < ptR.size(); ++k)
          if (k != i && k != j) {
            double d = lenPt2(newRCenter, ptR[k]);
            if (d > newR + eps) {
              flag = false;
              break;
            }
          }
        if (flag) {
          rCenter = newRCenter;
          r = newR;
          arr[0] = i;
          arr[1] = j;
          resizeR = true;
        }
      }
  if (arr[0] > 900 || arr[1] > 900) {
    printf("ERROR!");
    return;
  }
  resvec.push_back(ptR[arr[0]]);
  resvec.push_back(ptR[arr[1]]);
  ptR = resvec;
}
bool isOutCircle(unsigned int &id) { return lenPt2(rCenter, pt[id]) > r + eps; }
void calcNewR(unsigned int id) {
  ptR.push_back(pt[id]);
  createCircle();
  bool flag = true;
  while (flag) {
    flag = false;
    for (unsigned int i = 0; i < id; ++i) {
      if (isOutCircle(i)) {
        ptR.push_back(pt[i]);
        createCircle();
        flag = true;
        break;
      }
    }
  }
}
double calcR() {
  if (n == 1) return 0;
  ptR.clear();
  ptR.push_back(pt[0]);
  ptR.push_back(pt[1]);
  rCenter = centerPt2(ptR[0], ptR[1]);
  r = lenPt2(ptR[0], rCenter);
  for (int i = 2; i < n; ++i) {
    double d = lenPt2(rCenter, pt[i]);
    if (fabs(d - r) < eps) ptR.push_back(pt[i]);
  }
  for (int j = 2; j < n; ++j)
    if (lenPt2(rCenter, pt[j]) > r + eps) {
      calcNewR(j);
    }
  return r;
}
double calcR2() {
  if (n == 1) return 0;
  vector<Pt2d> ans;
  double r = 1e18;
  for (int i = 0; i < n; ++i)
    for (int j = i + 1; j < n; ++j) {
      Pt2d newRCenter = centerPt2(pt[i], pt[j]);
      double newR = lenPt2(pt[i], newRCenter);
      bool flag = true;
      for (int k = 0; k < n; ++k) {
        if (lenPt2(pt[k], newRCenter) > newR + eps) {
          flag = false;
          break;
        }
      }
      if (flag && newR < r) {
        r = newR;
        ans.resize(2);
        ans[0] = pt[i];
        ans[1] = pt[j];
      }
    }
  if (r == 1e18) {
    for (int i = 0; i < n; ++i)
      for (int j = i + 1; j < n; ++j)
        for (int k = j + 1; k < n; ++k) {
          Pt2d newRCenter = calcRCenter(pt[i], pt[j], pt[k]);
          double newR = lenPt2(pt[i], newRCenter);
          bool flag = true;
          for (int h = 0; h < n; ++h) {
            if (lenPt2(pt[h], newRCenter) > newR + eps) {
              flag = false;
              break;
            }
          }
          if (flag && newR < r) {
            r = newR;
            ans.resize(3);
            ans[0] = pt[i];
            ans[1] = pt[j];
            ans[2] = pt[k];
          }
        }
  }
  for (unsigned int i = 0; i < ans.size(); ++i) printf("%d ", ans[i].Tang);
  cout << endl;
  return r;
}
Pt2d calcPt2fromPt3(int a, int b, int c, int d, int e, int f) {
  if (a == 0 && b == 0) return Pt2d(d, e);
  if (b == 0 && c == 0) return Pt2d(e, f);
  if (c == 0 && a == 0) return Pt2d(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 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] = calcPt2fromPt3(A, B, C, pt3[j].x, pt3[j].y, pt3[j].z);
      pt[j].Tang = j + 1;
    }
    printf("%.7f\n", calcR());
  }
  return 0;
}
