Problem: You're given the centers of three equal sides of a strictly convex tetragon. Your task is to restore the initial tetragon.

Input

The first input line contains one number T — amount of tests (1 ≤ T ≤ 5·104). Each of the following T lines contains numbers x1, y1, x2, y2, x3, y3 — coordinates of different points that are the centers of three equal sides (non-negative integer numbers, not exceeding 10).

Output

For each test output two lines. If the required tetragon exists, output in the first line YES, in the second line — four pairs of numbers — coordinates of the polygon's vertices in clockwise or counter-clockwise order. Don't forget, please, that the tetragon should be strictly convex, i.e. no 3 of its points lie on one line. Output numbers with 9 characters after a decimal point.

If the required tetragon doen't exist, output NO in the first line, and leave the second line empty.

Examples

Input

3
1 1 2 2 3 3
0 1 1 0 2 2
9 3 7 9 9 8


Output

NO

YES
3.5 1.5 0.5 2.5 -0.5 -0.5 2.5 0.5
NO

Solution (in JAVA):

Solution:
import java.util.*;

public class D {

    static Scanner sc = new Scanner(System.in);

    static Point[] solve(Point p1, Point p2, Point p3) {
        Point p4 = p3.mirrorOn(p2);
        Line l1 = new Line(p1, p2).getPerpendicularIn(Point.middle(p1, p2));
        Line l2 = new Line(p2, p4).getPerpendicularIn(Point.middle(p2, p4));

        Point[] sol = new Point[4];
        sol[0] = l1.getIntersectionWith(l2);
        if (sol[0] == null)
            return null;
        sol[1] = sol[0].mirrorOn(p2);
        sol[2] = sol[1].mirrorOn(p3);
        sol[3] = sol[0].mirrorOn(p1);

        return new Polygon(sol).isConvex() ? sol : null;
    }

    public static void main(String[] args) {
        for (int T = sc.nextInt(); T > 0; --T) {
            Point p1 = new Point(sc.nextInt(), sc.nextInt());
            Point p2 = new Point(sc.nextInt(), sc.nextInt());
            Point p3 = new Point(sc.nextInt(), sc.nextInt());
            Point[] sol = solve(p1, p2, p3);
            if (sol == null)
                sol = solve(p2, p3, p1);
            if (sol == null)
                sol = solve(p3, p1, p2);
            if (sol == null)
                System.out.println("NO\n");
            else
                System.out.printf(
                        "YES\n%.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f\n",
                        sol[0].getX(), sol[0].getY(), sol[1].getX(), sol[1]
                                .getY(), sol[2].getX(), sol[2].getY(), sol[3]
                                .getX(), sol[3].getY());
        }
    }

}

class Point {

    protected static final double EPS = 1.e-9;

    public static Point middle(Point p, Point q) {
        return new Point((p.x + q.x) / 2., (p.y + q.y) / 2.);
    }

    protected double x, y;

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

    public boolean equals(Object o) {
        Point p = (Point) o;
        return Math.abs(x - p.x) < EPS && Math.abs(y - p.y) < EPS;
    }

    public double getX() {
        return x;
    }

    public double getY() {
        return y;
    }

    public Point mirrorOn(Point p) {
        return new Point(2 * p.x - x, 2 * p.y - y);
    }

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

}

class Line {

    protected static final double EPS = 1.e-9;

    protected double a, b, c;

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

    public Line(Point p, Point q) {
        a = p.getY() - q.getY();
        b = -p.getX() + q.getX();
        c = p.getX() * q.getY() - q.getX() * p.getY();
    }

    public boolean equals(Object o) {
        Line l = (Line) o;
        return (Math.abs(a * l.b - l.a * b) < EPS && Math
                .abs(b * l.c - l.b * c) < EPS);
    }

    public Point getIntersectionWith(Line l) {
        if (Math.abs(a * l.b - l.a * b) < EPS)
            return null;
        return new Point((b * l.c - l.b * c) / (a * l.b - l.a * b),
                (l.a * c - a * l.c) / (a * l.b - l.a * b));
    }

    public Line getPerpendicularIn(Point p) {
        return new Line(-b, a, b * p.getX() - a * p.getY());
    }

    public String toString() {
        return "" + a + " * x + " + b + " * y + " + c + " = 0";
    }

}

class Polygon {

    protected static double computeDeterminant(Point p, Point q, Point r) {
        return p.getX() * (q.getY() - r.getY()) - q.getX()
                * (p.getY() - r.getY()) + r.getX() * (p.getY() - q.getY());
    }

    protected Point[] p = null;

    public Polygon(Point[] p) {
        this.p = p;
    }

    public boolean isConvex() {
        double sign = Math.signum(computeDeterminant(p[p.length - 1], p[0],
                p[1]));
        for (int i = 1; i < p.length - 1; ++i)
            if (sign != Math
                    .signum(computeDeterminant(p[i - 1], p[i], p[i + 1])))
                return false;
        if (sign != Math.signum(computeDeterminant(p[p.length - 2],
                p[p.length - 1], p[0])))
            return false;
        return true;
    }

    public String toString() {
        StringBuffer buffer = new StringBuffer();
        buffer.append("{");
        for (int i = 0; i < p.length; ++i) {
            if (i > 0)
                buffer.append(", ");
            buffer.append(p[i]);
        }
        buffer.append("}");
        return buffer.toString();
    }

}