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 JAVA):

Solution:
import java.util.List;
import java.io.InputStreamReader;
import java.io.IOException;
import java.util.ArrayList;
import java.io.BufferedReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.Random;
import java.util.StringTokenizer;
import java.math.BigInteger;
import java.util.Collections;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 * @author AlexFetisov
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		TaskE solver = new TaskE();
		solver.solve(1, in, out);
		out.close();
	}
}

class TaskE {
    static Random r = new Random(3731L);

    public void solve(int testNumber, InputReader in, PrintWriter out) {

        int n = in.nextInt();
        int m = in.nextInt();
        Point3D[] spheres = new Point3D[n];
        for (int i = 0; i < n; ++i) {
            spheres[i] = new Point3D(in);
        }
        for (int i = 0; i < m; ++i) {
            double a = in.nextDouble();
            double b = in.nextDouble();
            double c = in.nextDouble();
            Plane3D plane = new Plane3D(a, b, c, 0);
            Point3D[] p = new Point3D[n];
            for (int j = 0; j < n; ++j) {
//                double t = -(plane.d + plane.a * spheres[j].x + plane.b * spheres[j].y + plane.c * spheres[j].z) /
//                        (DoubleUtils.sqr(plane.a) + DoubleUtils.sqr(plane.b) + DoubleUtils.sqr(plane.c));
//                p[j] = new Point3D(spheres[j].x + plane.a * t, spheres[j].y + plane.b * t, spheres[j].z + plane.c * t);
                p[j] = Geometry3DUtils.getProjectionOnPlane(spheres[j], plane);
            }

            rotation(a, b, c, p);
            List<Point> points = new ArrayList<Point>();
            for (int j = 0; j < n; ++j) {
                points.add(new Point(p[j].x, p[j].y));
            }

            double best = 1e100;
            for (int iter = 0; iter < 5; ++iter) {
                Point ce = solve1(points);
                double res = 0;
                for (Point po : points) {
                    res = Math.max(res, po.distanceTo(ce));
                }
                if (DoubleUtils.compareTo(best, res) > 0) {
                    best = res;
                }
            }
            out.println(best);
        }
    }

    Point solve1(List<Point> p) {
        Collections.shuffle(p, r);
        if (p.size() == 1) {
            return p.get(0);
        } else {
            double r = p.get(0).distanceTo(p.get(1)) / 2;
            Point c = p.get(0).add(p.get(1)).div(2);
            for (int j = 2; j < p.size(); ++j) {
                if (DoubleUtils.compareTo(p.get(j).distanceTo(c), r) > 0) {
                    c = solve2(p.subList(0, j), p.get(j));
                    r = c.distanceTo(p.get(j));
                }
            }
            return c;
        }
    }

    Point solve2(List<Point> p, Point po) {
        Collections.shuffle(p, r);
        double r = p.get(0).distanceTo(po) / 2;
        Point c = p.get(0).add(po).div(2);
        for (int i = 1; i < p.size(); ++i) {
            if (DoubleUtils.compareTo(p.get(i).distanceTo(c), r) > 0) {
                c = solve3(p.subList(0, i), p.get(i), po);
                r = c.distanceTo(po);
            }
        }
        return c;
    }

    Point solve3(List<Point> p, Point po, Point po2) {
        Collections.shuffle(p, r);
        double r = po.distanceTo(po2) / 2;
        Point c = po.add(po2).div(2);
        for (int i = 0; i < p.size(); ++i) {
            if (DoubleUtils.compareTo(p.get(i).distanceTo(c), r) > 0) {
                Circle cc = new Circle(po, po2, p.get(i));
                c = cc.center;
                r = c.distanceTo(po);
            }
        }
        return c;
    }

    private void rotation(double a, double b, double c, Point3D[] p) {
        double angle = Math.PI / 2 - Math.atan2(c, b);
        double tempB = b;
        double tempC = c;
        c = Math.cos(angle) * tempC + Math.sin(angle) * tempB;
        b = -Math.sin(angle) * tempC + Math.cos(angle) * tempB;


        for (Point3D point : p) {
            double ty = point.y;
            double tz = point.z;
            point.z = Math.cos(angle) * tz + Math.sin(angle) * ty;
            point.y = -Math.sin(angle) * tz + Math.cos(angle) * ty;

        }

        angle = Math.PI / 2 - Math.atan2(c, a);
        double tempA = a;
        tempC = c;
        c = Math.cos(angle) * tempC + Math.sin(angle) * tempA;
        a = -Math.sin(angle) * tempC + Math.cos(angle) * tempA;


        for (Point3D point : p) {
            double tx = point.x;
            double tz = point.z;
            point.z = Math.cos(angle) * tz + Math.sin(angle) * tx;
            point.x = -Math.sin(angle) * tz + Math.cos(angle) * tx;
        }
    }
}

class InputReader {
    private BufferedReader reader;
    private StringTokenizer stt;

    public InputReader(InputStream stream) {
        reader = new BufferedReader(new InputStreamReader(stream));
    }

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            return null;
        }
    }

    public String nextString() {
        while (stt == null || !stt.hasMoreTokens()) {
            stt = new StringTokenizer(nextLine());
        }
        return stt.nextToken();
    }

    public int nextInt() {
        return Integer.parseInt(nextString());
    }

    public double nextDouble() {
        return Double.parseDouble(nextString());
    }

}

class Point3D implements Comparable<Point3D> {
    public double x;
    public double y;
    public double z;

    public String toString() {
        StringBuilder b = new StringBuilder();
        b.append('(').append(x).append(',').append(y).append(',').append(z).append(')');
        return b.toString();
    }

    public Point3D(double x, double y, double z) {
        this.x = x;
        this.y = y;
        this.z = z;
    }

    public Point3D(InputReader in) {
        this.x = in.nextDouble();
        this.y = in.nextDouble();
        this.z = in.nextDouble();
    }

    public Point3D add(Point3D p) {
        return new Point3D(x + p.x, y + p.y, z + p.z);
    }

    public Point3D mul(double k) {
        return new Point3D(x * k, y * k, z * k);
    }

    public int compareTo(Point3D o) {
        if (DoubleUtils.compareTo(x, o.x) != 0) {
            return DoubleUtils.compareTo(x, o.x);
        }
        if (DoubleUtils.compareTo(y, o.y) != 0) {
            return DoubleUtils.compareTo(y, o.y);
        }
        return DoubleUtils.compareTo(z, o.z);
    }
}

class Plane3D {
    public double a, b, c, d;

    public Plane3D(double a, double b, double c, double d) {
        this.a = a;
        this.b = b;
        this.c = c;
        this.d = d;
    }

    public Plane3D norm() {
        double D = DoubleUtils.sqrt(a * a + b * b + c * c);
        a /= D;
        b /= D;
        c /= D;
        d /= D;
        return new Plane3D(a, b, c, d);
    }

    public double getSignedDistanceTo(Point3D point) {
        Plane3D normPlane = norm();
        return a * point.x + b * point.y + c * point.z + d;
    }

    public Point3D getNormal() {
        return new Point3D(a, b, c);
    }
}

class Geometry3DUtils {
    public static Point3D getProjectionOnPlane(Point3D point, Plane3D plane) {
        double dst = plane.getSignedDistanceTo(point);
        Point3D v = plane.getNormal().mul(dst);
        return point.add(v);
    }
}

class Point implements Comparable<Point> {
    public double x, y;

    public Point(double x, double y) {
        this.x = x;
        this.y = y;
    }

    public String toString() {
        return "(" + x + ", " + y + " )";
    }

    public boolean equals(Object o) {
        Point p = (Point) o;
        return DoubleUtils.compareTo(x, p.x) == 0 && DoubleUtils.compareTo(y, p.y) == 0;
    }

    public int hashCode() {
        int result;
        long temp;
        temp = x != +0.0d ? Double.doubleToLongBits(x) : 0L;
        result = (int) (temp ^ (temp >>> 32));
        temp = y != +0.0d ? Double.doubleToLongBits(y) : 0L;
        result = 31 * result + (int) (temp ^ (temp >>> 32));
        return result;
    }

    public Point add(Point p) {
        return new Point(x + p.x, y + p.y);
    }

    public Point sub(Point p) {
        return new Point(x - p.x, y - p.y);
    }

    public Point div(double k) {
        return new Point(x / k, y / k);
    }

    public double dotProduct(Point p) {
        return x * p.x + y * p.y;
    }

    public double length() {
        return DoubleUtils.sqrt(dotProduct(this));
    }

    public double distanceTo(Point p) {
        return sub(p).length();
    }

    /*public double distanceToLine(Line l) {
        if (l.hasPoints()) {
            return distanceToLine(l.p1, l.p2);
        }
        Line normLine = l.norm();
        return normLine.a * x + normLine.b * y + normLine.c;
    } */

    // Rotate 90 degrees clockwise (positive direction).
    Point rotate() {
        return new Point(-y, x);
    }

    public int compareTo(Point o) {
        int temp = DoubleUtils.compareTo(x, o.x);
        if (temp == 0) {
            return DoubleUtils.compareTo(y, o.y);
        }
        return temp;
    }
}

class DoubleUtils {
    public static final double EPS = 1e-8;

    public static double sqr(double x) {
        return x * x;
    }

    public static int compareTo(double a, double b) {
        if (doubleEqual(a, b)) {
            return 0;
        }
        if (a < b) {
            return -1;
        }
        return 1;
    }

    private static boolean doubleEqual(double a, double b) {
        return Math.abs(a - b) < EPS;
    }

    public static double sqrt(double a) {
        if (compareTo(a, 0) < 0) {
            System.exit(1);
        }
        if (a < 0) return 0;
        return Math.sqrt(a);
    }

    public static double hypot(double a, double b) {
        return sqrt(sqr(a) + sqr(b));
    }
}

class Circle {
    public final Point center;
    public final double radius;

    public Circle(Point p1, Point p2, Point p3) {
        Point middle12 = p1.add(p2).div(2);
        Point middle23 = p2.add(p3).div(2);
        Point v12 = p2.sub(p1).rotate();
        Point v23 = p3.sub(p2).rotate();
        Point p12 = middle12.add(v12);
        Point p23 = middle23.add(v23);
        Line l1 = new Line(middle12, p12);
        Line l2 = new Line(middle23, p23);

        if (l1.intersect(l2) == null) {
            Point A = p1;
            Point B = p2;
            if (DoubleUtils.compareTo(A.distanceTo(B), p1.distanceTo(p3)) < 0) {
                A = p1;
                B = p3;
            }
            if (DoubleUtils.compareTo(A.distanceTo(B), p2.distanceTo(p3)) < 0) {
                A = p2;
                B = p3;
            }
            center = A.add(B).div(2);
            radius = center.distanceTo(A);
            return;
            //throw new AssertionError("Points on same line!");
        }
        center = l1.intersect(l2);
        radius = center.distanceTo(p1);
    }

}

class Line {
    public final double a;
    public final double b;
    public final double c;
    boolean hasPoints;

    public Line(double a, double b, double c) {
        double h = DoubleUtils.hypot(a, b);
        this.a = a / h;
        this.b = b / h;
        this.c = c / h;
        hasPoints = false;
    }

    public Line(Point p1, Point p2) {
        a = p2.y - p1.y;
        b = p1.x - p2.x;
        c = -(p1.x * a + p1.y * b);
        new Line(a, b, c);
        hasPoints = true;
    }

    public Point intersect(Line other) {
        if (parallel(other)) {
            return null;
        }
        double determinant = b * other.a - a * other.b;
        double x = (c * other.b - b * other.c) / determinant;
        double y = (a * other.c - c * other.a) / determinant;
        return new Point(x, y);
    }

    public boolean parallel(Line other) {
        return DoubleUtils.compareTo(Math.abs(a * other.b - b * other.a), 0) == 0;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        Line line = (Line) o;

        if (!parallel(line)) return false;
        if (Math.abs(a * line.c - c * line.a) > DoubleUtils.EPS || Math.abs(b * line.c - c * line.b) > DoubleUtils.EPS) return false;

        return true;
    }
}