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.io.*;
import java.util.Locale;
import java.util.StringTokenizer;

import static java.lang.Math.abs;
import static java.lang.Math.max;
import static java.lang.Math.sqrt;

public class D {

    static final double EPS = 1e-17;
    static final double EPS2 = 1e-9;
    static final boolean DEBUG = "on".equals(System.getProperty("debug"));

    public static void main(String[] args) throws IOException {
//        if (true) {
//            gen();
//            System.exit(1);
//        }
        Locale.setDefault(Locale.US);
        new D().solve();
    }

    static void gen() throws IOException {
        PrintWriter pw = new PrintWriter("23/d.in");
        pw.println(50000);
        for (int i = 0; i < 50000; i++) {
            pw.println("-10 -10 10 10 -9 -10");
        }
        pw.close();
    }

    StringTokenizer st = new StringTokenizer("");
    BufferedReader br;

    private void solve() throws IOException {
        InputStream is = DEBUG ? new FileInputStream("23/d.in") : System.in;
        br = new BufferedReader(new InputStreamReader(is));
        int nt = nextInt();
        PrintWriter pw = new PrintWriter(System.out);
        for (int i = 0; i < nt; i++) {
            subsolve(pw);
        }
        pw.close();
        br.close();
    }

    void subsolve(PrintWriter pw) throws IOException {
        Point a = nextPoint();
        Point b = nextPoint();
        Point c = nextPoint();
        Point[] ans = slv(a, b, c);
        if (ans == null) {
            ans = slv(a, c, b);
        }
        if (ans == null) {
            ans = slv(b, a, c);
        }
        if (ans == null) {
            ans = slv(b, c, a);
        }
        if (ans == null) {
            ans = slv(c, a, b);
        }
        if (ans == null) {
            ans = slv(c, b, a);
        }
        if (ans == null) {
            pw.println("NO");
            pw.println();
        } else {
            pw.println("YES");
            boolean first = true;
            for (Point p : ans) {
                if (!first) {
                    pw.print(" ");
                }
                first = false;
                pw.printf("%.15f %.15f", p.x, p.y);
            }
            pw.println();
        }
    }

    private Point[] slv(final Point a, final Point b, final Point c) {
        if (!right(a, b, c)) {
            return null;
        }

        Conf conf_ab = new Conf(a, b);
        Conf conf_bc = new Conf(b, c);
        final double start = max(conf_ab.halfDist, conf_bc.halfDist);
        final double end = 1e4;
        double rmin = start;
        double rmax = end;
        while (rmax - rmin > EPS) {
            double r = (rmin + rmax) / 2;
            if (r == rmin || r == rmax) break;
            Point m1 = conf_ab.find(r);
            Point m2 = conf_bc.find(r);
            double area = area(m1, b, m2);
            if (area > 0) {
                rmin = r;
            } else {
                rmax = r;
            }
        }
        final double r = (rmin + rmax) / 2;
        final Point m1 = conf_ab.find(r);
        final Point m2 = conf_bc.find(r);
        double area = area(m1, b, m2);
        if (abs(area) > EPS2) {
            return null;
        }
        Point last = next(m2, c);
        Point first = next(m1, a);
        if (right(first, m1, m2) && right(m1, m2, last) && right(m2, last, first) && right(last, first, m1)) {
            return new Point[] {first, m1, m2, last};
        }
        return null;
    }

    boolean right(Point a, Point b, Point c) {
        double vp = area(a, b, c);
        return vp > EPS2;
    }

    double area(Point a, Point b, Point c) {
        Point ab = v(a, b), bc = v(b, c);
        return vp(bc, ab);
    }

    private Point next(Point a, Point b) {
        Point v = v(a, b);
        return p(b.x + v.x, b.y + v.y);
    }

    Point rotate90CounterClockwise(Point v) {
        return p(-v.y, v.x);
    }

    Point norm(Point v) {
        double len = len(v);
        return p(v.x / len, v.y / len);
    }

    double dist(Point a, Point b) {
        return len(v(a, b));
    }

    double len(Point a) {
        return sqrt(a.x * a.x + a.y * a.y);
    }

    Point v(Point from, Point to) {
        return p(to.x - from.x, to.y - from.y);
    }

    double vp(Point a, Point b) {
        return a.x * b.y - a.y * b.x;
    }

    Point p(double x, double y) {
        return new Point(x, y);
    }

    class Conf {

        final double halfDist;
        final Point mid;
        final Point v;

        Conf(Point a, Point b) {
            this.halfDist = dist(a, b) / 2;
            this.mid = p((a.x + b.x) / 2, (a.y + b.y) / 2);
            Point ab = v(a, b);
            Point rotated = rotate90CounterClockwise(ab);
            this.v = norm(rotated);
        }

        Point find(double r) {
            double l = sqrt(max(0, r * r - halfDist * halfDist));
            Point intersect = p(mid.x + v.x * l, mid.y + v.y * l);
            return intersect;
        }
    }

    static class Point {
        final double x, y;

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

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

    String nextToken() throws IOException {
        while (!st.hasMoreElements()) {
            st = new StringTokenizer(br.readLine());
        }
        return st.nextToken();
    }

    int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    Point nextPoint() throws IOException {
        int x = nextInt();
        int y = nextInt();
        return p(x, y);
    }

}