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;
int dcmp(double p) {
  if (abs(p) < 1e-13) return 0;
  return p > 1e-13 ? 1 : -1;
}
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
  friend Point operator+(const Point &a, const Point &b) {
    return Point(a.x + b.x, a.y + b.y);
  }
  friend Point operator-(const Point &a, const Point &b) {
    return Point(a.x - b.x, a.y - b.y);
  }
  friend Point operator*(const Point &a, const double &p) {
    return Point(a.x * p, a.y * p);
  }
  friend bool operator==(const Point &a, const Point &b) {
    return !dcmp(a.x - b.x) && !dcmp(a.y - b.y);
  }
} p[5];
double Cross(const Point &a, const Point &b) { return a.x * b.y - a.y * b.x; }
bool Inter(const Point &a, const Point &b, const Point &c, const Point &d) {
  int d1 = dcmp(Cross(b - a, c - a)), d2 = dcmp(Cross(b - a, d - a));
  int d3 = dcmp(Cross(d - c, a - c)), d4 = dcmp(Cross(d - c, b - c));
  return d1 * d2 <= 0 && d3 * d4 <= 0;
}
bool work(const Point &a, const Point &b, const Point &c) {
  double xb = b.x, yb = b.y, xa = a.x, ya = a.y, xc = c.x, yc = c.y;
  double A = 2 * xb, B = 2 * yb, C = xb * xb + yb * yb - xa * xa - ya * ya,
         D = xb * xb + yb * yb - xc * xc - yc * yc;
  double p1 = (2 * xb - 2 * xa), p2 = (2 * yb - 2 * ya), q1 = (2 * xb - 2 * xc),
         q2 = (2 * yb - 2 * yc);
  double E = q1 * A + q2 * B - D;
  if (!dcmp(p1 * q2 - q1 * p2) || !dcmp(p2)) return false;
  double x1 = (C * q2 - E * p2) / (p1 * q2 - q1 * p2), y1 = (C - p1 * x1) / p2,
         x2 = A - x1, y2 = B - y1;
  Point p = Point(x1, y1), q = Point(x2, y2);
  Point pa = p + (a - p) * 2, qa = q + (c - q) * 2;
  int d1 = dcmp(Cross(p - pa, q - pa)), d2 = dcmp(Cross(q - p, qa - p)),
      d3 = dcmp(Cross(qa - q, pa - q)), d4 = dcmp(Cross(pa - qa, p - qa));
  if (!((d1 > 0 && d2 > 0 && d3 > 0 && d4 > 0) ||
        (d1 < 0 && d2 < 0 && d3 < 0 && d4 < 0)))
    return false;
  if (p == q || p == pa || p == qa || q == pa || q == qa || pa == qa)
    return false;
  printf("YES\n");
  printf("%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", pa.x + 1e-13,
         pa.y + 1e-13, p.x + 1e-13, p.y + 1e-13, q.x + 1e-13, q.y + 1e-13,
         qa.x + 1e-13, qa.y + 1e-13);
  return true;
}
int main() {
  int test;
  cin >> test;
  for (int i = 1; i <= test; i++) {
    cin >> p[1].x >> p[1].y >> p[2].x >> p[2].y >> p[3].x >> p[3].y;
    int s = 0;
    for (int j = 1; j <= 3 && s == 0; j++)
      for (int k = 1; k <= 3 && s == 0; k++)
        if (j != k)
          if (work(p[j], p[k], p[6 - j - k])) s++;
    if (s == 0) printf("NO\n\n");
  }
  return 0;
}