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

Solution:
#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-12;
const double inf = 1e18;
bool lt(double a, double b) { return b - a > eps; }
bool eq(double a, double b) { return abs(a - b) <= eps; }
bool leq(double a, double b) { return lt(a, b) || eq(a, b); }
bool gt(double a, double b) { return a - b > eps; }
bool geq(double a, double b) { return gt(a, b) || eq(a, b); }
struct pt {
  double x, y;
  pt() {}
  pt(double x, double y) : x(x), y(y) {}
  pt operator-(const pt& other) const { return {x - other.x, y - other.y}; }
  pt operator+(const pt& other) const { return {x + other.x, y + other.y}; }
  pt operator/(double k) const { return {x / k, y / k}; }
  pt operator*(double k) const { return {x * k, y * k}; }
};
double cross(const pt& p, const pt& q) { return p.x * q.y - p.y * q.x; }
double dist(const pt& a, const pt& b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
struct line {
  double a, b, c;
  line(double a, double b, double c) : a(a), b(b), c(c) {}
  line(const pt& p, const pt& q) {
    a = p.y - q.y;
    b = q.x - p.x;
    c = cross(p, q);
    double tmp = sqrt(a * a + b * b);
    a /= tmp, b /= tmp, c /= tmp;
  }
};
pt intersect(const line& l, const line& m) {
  double a1 = l.a, b1 = l.b, c1 = -l.c;
  double a2 = m.a, b2 = m.b, c2 = -m.c;
  double det = a1 * b2 - a2 * b1;
  if (eq(det, 0)) {
    return {inf, inf};
  }
  double det1 = c1 * b2 - c2 * b1;
  double det2 = a1 * c2 - a2 * c1;
  return {det1 / det, det2 / det};
}
line serper(const pt& a, const pt& b) {
  line l(a, b);
  pt p = (a + b) / 2.0;
  pt v = {l.a, l.b};
  pt q = p + v;
  return line(p, q);
}
pair<pt, pt> build(const pt& p, const line& l, const line& m) {
  pt q = intersect(l, m);
  if (eq(q.x, inf) && eq(q.y, inf)) {
    return {{inf, inf}, {inf, inf}};
  }
  pt v = p - q;
  pt r = p + v;
  pt a1 = {l.b, -l.a};
  line l1(r, r + a1);
  pt a2 = {m.b, -m.a};
  line m1(r, r + a2);
  pt y = intersect(l1, m);
  pt x = intersect(m1, l);
  return make_pair(x, y);
}
int main() {
  int tt;
  scanf("%d", &tt);
  while (tt--) {
    vector<pt> p(3);
    for (int i = 0; i < 3; ++i) {
      scanf("%lf%lf", &p[i].x, &p[i].y);
    }
    vector<vector<int> > v = {{0, 1, 2}, {1, 0, 2}, {2, 0, 1}};
    bool out = false;
    for (int i = 0; i < 3; ++i) {
      vector<pt> q(3);
      for (int j = 0; j < 3; ++j) {
        q[j] = p[v[i][j]];
      }
      line l = serper(q[0], q[1]);
      line m = serper(q[0], q[2]);
      pair<pt, pt> w = build(q[0], l, m);
      if (eq(w.first.x, inf) && eq(w.first.y, inf)) {
        continue;
      }
      double len = dist(w.first, q[0]);
      pt a = w.first, b = w.second;
      if (!eq(dist(b, q[2]), len) || !eq(dist(a, q[1]), len)) {
        continue;
      }
      pt c = b + (q[2] - b) * 2.0;
      pt d = a + (q[1] - a) * 2.0;
      vector<pt> r = {a, b, c, d};
      bool all_negative = true, all_positive = true;
      for (int j = 0; j < 4; ++j) {
        pt aa = r[(j + 1) % 4] - r[j];
        pt bb = r[(j + 2) % 4] - r[(j + 1) % 4];
        if (geq(cross(aa, bb), 0)) {
          all_negative = false;
        }
        if (leq(cross(aa, bb), 0)) {
          all_positive = false;
        }
      }
      if (all_negative || all_positive) {
        printf("YES\n");
        printf("%.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f\n", a.x, a.y, b.x, b.y,
               c.x, c.y, d.x, d.y);
        out = true;
        break;
      }
    }
    if (!out) {
      printf("NO\n\n");
    }
  }
}