Problem: In the year of 3000 travelling around parallel realities became a routine thing. However one has to take into consideration that travelling like that is highly dangerous as you never know beforehand where you're gonna get...

Little Vasya, for instance, found himself in a gaming reality and now he has to successfully complete all levels of a very weird game to get back. The gaming reality is a three-dimensional space where n points are given. The game has m levels and at the beginning of the i-th level the player is positioned at some plane Qi that passes through the origin. On each level Vasya has to use special robots to construct and activate n powerful energy spheres of the equal radius with centers at the given points. The player chooses the radius of the spheres himself. The player has to spend R units of money to construct spheres whose radius equals R (consequently, one can construct spheres whose radius equals zero for free). Besides, once for each level a player can choose any point in space and release a laser ray from there, perpendicular to plane Qi (this action costs nothing). The ray can either be directed towards the plane or from the plane. The spheres that share at least one point with the ray will be immediately activated. The level is considered completed if the player has managed to activate all spheres. Note that the centers of the spheres are the same for all m levels but the spheres do not remain: the player should construct them anew on each new level.

Help Vasya find out what minimum sum of money will be enough to complete each level.

Input

The first line contains two integers n and m (1 ≤ n ≤ 900, 1 ≤ m ≤ 100) — the number of energetic spheres and the number of levels in the game correspondingly. 

Each of the following n lines contains three integers xi, yi, zi (0 ≤ xi, yi, zi ≤ 104) — the coordinates of the center of the i-th sphere. Assume that these points do not change their positions throughout the game.

Then follow m lines, each containing three integers ai, bi, ci (0 ≤ ai, bi, ci ≤ 100, ai2 + bi2 + ci2 > 0). These numbers are the coefficients in the equation of plane Qi (aix + biy + ciz = 0), where the player is positioned at the beginning of the i-th level.

Output

Print m numbers, one per line: the i-th line should contain the minimum sum of money needed to complete the i-th level. The absolute or relative error should not exceed 10 - 6.

Examples

Input

4 1
0 0 0
0 1 0
1 0 0
1 1 0
0 0 1


Output

0.7071067812


Input

5 3
0 1 0
1 0 1
1 2 1
2 0 1
1 3 0
1 1 1
1 2 3
3 0 3


Output

1.6329931619
1.6366341768
1.5411035007


Input

2 1
0 20 0
0 0 0
0 10 0


Output

0.0000000000

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
const long double EPS = 1e-8;
const int INF = 1000000000;
struct Point {
  long double x, y, z;
  Point() {}
  Point(long double a, long double b, long double c) : x(a), y(b), z(c) {}
  Point operator*(const Point& p) const {
    return Point(y * p.z - p.y * z, z * p.x - p.z * x, x * p.y - p.x * y);
  }
  void Normate() {
    long double norm = sqrt(x * x + y * y + z * z);
    x /= norm;
    y /= norm;
    z /= norm;
  }
};
long double CalculateDistance(const Point& p1, const Point& p2) {
  return sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y) +
              (p1.z - p2.z) * (p1.z - p2.z));
}
struct Circle {
  Point center;
  long double radius;
  Circle() : center(Point(0, 0, 0)), radius(0) {}
  Circle(const Point& p1) : center(Point(p1.x, p1.y, p1.z)), radius(0) {}
  Circle(const Point& p1, const Point& p2) {
    center = Point((p1.x + p2.x) / 2, (p1.y + p2.y) / 2, (p1.z + p2.z) / 2);
    radius = CalculateDistance(center, p1);
  }
  Circle(const Point& p1, const Point& p2, const Point& p3) {
    Point V(p2.x - p1.x, p2.y - p1.y, p2.z - p1.z);
    V.Normate();
    Point W(p3.x - p1.x, p3.y - p1.y, p3.z - p1.z);
    W.Normate();
    Point N = V * W;
    N.Normate();
    Point D1 = V * N;
    Point D2 = W * N;
    Point M1 = Point((p1.x + p2.x) / 2, (p1.y + p2.y) / 2, (p1.z + p2.z) / 2);
    Point M2 = Point((p1.x + p3.x) / 2, (p1.y + p3.y) / 2, (p1.z + p3.z) / 2);
    long double alpha;
    if (fabs(D1.y * D2.x - D1.x * D2.y) > EPS) {
      alpha = (D2.x * (M2.y - M1.y) - D2.y * (M2.x - M1.x)) /
              (D1.y * D2.x - D1.x * D2.y);
    } else if (fabs(D1.z * D2.y - D1.y * D2.z) > EPS) {
      alpha = (D2.y * (M2.z - M1.z) - D2.z * (M2.y - M1.y)) /
              (D1.z * D2.y - D1.y * D2.z);
    } else {
      alpha = (D2.z * (M2.x - M1.x) - D2.x * (M2.z - M1.z)) /
              (D1.x * D2.z - D1.z * D2.x);
    }
    center =
        Point(M1.x + alpha * D1.x, M1.y + alpha * D1.y, M1.z + alpha * D1.z);
    radius = CalculateDistance(center, p1);
    assert(fabs(radius - CalculateDistance(center, p2)) < EPS);
    assert(fabs(radius - CalculateDistance(center, p3)) < EPS);
  }
};
vector<Point> ProjectPoints(int A, int B, int C, const vector<Point>& points) {
  vector<Point> result(points.size());
  for (size_t i = 0; i < points.size(); ++i) {
    long double alpha = -(A * points[i].x + B * points[i].y + C * points[i].z) /
                        (A * A + B * B + C * C);
    result[i] = Point(points[i].x + alpha * A, points[i].y + alpha * B,
                      points[i].z + alpha * C);
  }
  return result;
}
int IsPointInCircle(const Point& p, const Circle& c) {
  return CalculateDistance(p, c.center) <= c.radius + EPS;
}
Circle FindMinimumEnclosingCircle(vector<Point>& not_verified_points,
                                  vector<Point>& circumference_points) {
  if (not_verified_points.size() == 0 || circumference_points.size() >= 3) {
    if (circumference_points.size() == 0) {
      return Circle();
    }
    if (circumference_points.size() == 1) {
      return Circle(circumference_points[0]);
    }
    if (circumference_points.size() == 2) {
      return Circle(circumference_points[0], circumference_points[1]);
    }
    return Circle(circumference_points[0], circumference_points[1],
                  circumference_points[2]);
  } else {
    int index = rand() % not_verified_points.size();
    Point p = not_verified_points[index];
    not_verified_points[index] =
        not_verified_points[not_verified_points.size() - 1];
    not_verified_points.pop_back();
    Circle c =
        FindMinimumEnclosingCircle(not_verified_points, circumference_points);
    if (!IsPointInCircle(p, c)) {
      circumference_points.push_back(p);
      c = FindMinimumEnclosingCircle(not_verified_points, circumference_points);
      circumference_points.pop_back();
    }
    not_verified_points.push_back(p);
    return c;
  }
}
Circle FindMinimumEnclosingCircleBruteForce(const vector<Point>& points) {
  Circle result;
  result.radius = INF;
  for (size_t i = 0; i < points.size(); ++i)
    for (size_t j = i + 1; j < points.size(); ++j) {
      int enclosing_circle = 1;
      Circle c(points[i], points[j]);
      for (size_t k = 0; k < points.size(); ++k) {
        if (!IsPointInCircle(points[k], c)) {
          enclosing_circle = 0;
          break;
        }
      }
      if (enclosing_circle && c.radius < result.radius) {
        result = c;
      }
    }
  for (size_t i = 0; i < points.size(); ++i)
    for (size_t j = i + 1; j < points.size(); ++j)
      for (size_t k = j + 1; k < points.size(); ++k) {
        Circle c(points[i], points[j], points[k]);
        int enclosing_circle = 1;
        for (size_t l = 0; l < points.size(); ++l) {
          if (!IsPointInCircle(points[l], c)) {
            enclosing_circle = 0;
            break;
          }
        }
        if (enclosing_circle && c.radius < result.radius) {
          result = c;
        }
      }
  return result;
}
int main() {
  int seed = 1319233241;
  srand(seed);
  int num_points, num_tests;
  vector<Point> points;
  scanf("%d %d", &num_points, &num_tests);
  for (int i = 0; i < num_points; ++i) {
    int x, y, z;
    scanf("%d %d %d", &x, &y, &z);
    points.push_back(Point(x, y, z));
  }
  for (int test = 1; test <= num_tests; ++test) {
    int A, B, C;
    scanf("%d %d %d ", &A, &B, &C);
    vector<Point> projected_points = ProjectPoints(A, B, C, points);
    vector<Point> circumference_points = vector<Point>();
    Circle min_circle =
        FindMinimumEnclosingCircle(projected_points, circumference_points);
    cout << fixed << setprecision(10) << min_circle.radius << endl;
  }
  return 0;
}