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;
struct point {
  double x, y;
  void in() { scanf("%lf%lf", &x, &y); }
};
long double dis(point p1, point p2) {
  long double d =
      sqrt((p1.x - p2.x) * (p1.x - p2.x) + (p1.y - p2.y) * (p1.y - p2.y));
  return d;
}
bool onSegment(point p, point q, point r) {
  if (q.x <= max(p.x, r.x) && q.x >= min(p.x, r.x) && q.y <= max(p.y, r.y) &&
      q.y >= min(p.y, r.y))
    return true;
  return false;
}
int orientation(point p, point q, point r) {
  int val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  if (val == 0) return 0;
  return (val > 0) ? 1 : 2;
}
bool doIntersect(point p1, point q1, point p2, point q2) {
  int o1 = orientation(p1, q1, p2);
  int o2 = orientation(p1, q1, q2);
  int o3 = orientation(p2, q2, p1);
  int o4 = orientation(p2, q2, q1);
  if (o1 != o2 && o3 != o4) return true;
  if (o1 == 0 && onSegment(p1, p2, q1)) return true;
  if (o2 == 0 && onSegment(p1, q2, q1)) return true;
  if (o3 == 0 && onSegment(p2, p1, q2)) return true;
  if (o4 == 0 && onSegment(p2, q1, q2)) return true;
  return false;
}
long double calc(point a, point b, point c) {
  long double BAx = a.x - b.x;
  long double BAy = a.y - b.y;
  long double BCx = c.x - b.x;
  long double BCy = c.y - b.y;
  return (BAx * BCy - BAy * BCx);
}
bool isConvex(point points[4]) {
  int n = 4;
  long long orent = orientation(points[0], points[1], points[2]);
  for (int i = 1; i < n; i++) {
    int a = i;
    int b = (i + 1) % n;
    int c = (i + 2) % n;
    long long crossProduct = orientation(points[a], points[b], points[c]);
    if (crossProduct != orent) return false;
  }
  return true;
}
long double GJ(vector<vector<long double>> &a, vector<long double> &ans) {
  int n = (int)a.size();
  int m = (int)a[0].size() - 1;
  vector<int> where(m, -1);
  for (int col = 0, row = 0; col < m && row < n; ++col) {
    int sel = row;
    for (int i = row; i < n; ++i)
      if (abs(a[i][col]) > abs(a[sel][col])) sel = i;
    if (abs(a[sel][col]) < 0.00000001) continue;
    for (int i = col; i <= m; ++i) swap(a[sel][i], a[row][i]);
    where[col] = row;
    for (int i = 0; i < n; ++i)
      if (i != row) {
        double c = a[i][col] / a[row][col];
        for (int j = col; j <= m; ++j) a[i][j] -= a[row][j] * c;
      }
    ++row;
  }
  ans.assign(m, 0);
  for (int i = 0; i < m; ++i)
    if (where[i] != -1) ans[i] = a[where[i]][m] / a[where[i]][i];
  for (int i = 0; i < n; ++i) {
    double sum = 0;
    for (int j = 0; j < m; ++j) sum += ans[j] * a[i][j];
    if (abs(sum - a[i][m]) > 0.00000001) return 0;
  }
  for (int i = 0; i < m; ++i)
    if (where[i] == -1) return 1e17;
  return 1;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  long long tc;
  scanf("%lld", &tc);
  while (tc--) {
    point p[3];
    point ans[4];
    p[0].in();
    p[1].in();
    p[2].in();
    bool chk = 0;
    for (int ii = 0; ii < 3; ii++) {
      long long f, s, t;
      f = (0 + ii) % 3;
      s = (1 + ii) % 3;
      t = (2 + ii) % 3;
      point aa = p[f];
      point bb = p[s];
      point cc = p[t];
      long long n = 4;
      long long m = 1;
      long double A[4][4] = {{cc.x - aa.x, cc.y - aa.y, 0, 0},
                             {0, 0, bb.x - aa.x, bb.y - aa.y},
                             {1, 0, 1, 0},
                             {0, 1, 0, 1}};
      long double B[4][1];
      B[0][0] = 0.5 * (cc.y * cc.y - aa.y * aa.y + (cc.x * cc.x - aa.x * aa.x));
      B[1][0] = 0.5 * (bb.y * bb.y - aa.y * aa.y + (bb.x * bb.x - aa.x * aa.x));
      B[2][0] = 2.0 * aa.x;
      B[3][0] = 2.0 * aa.y;
      vector<vector<long double>> a(5);
      vector<long double> b(4);
      for (int i = 0; i < n + 1; i++) {
        for (int j = 0; j < n; j++) a[i].push_back(A[i][j]);
        a[i].push_back(B[i][0]);
        ;
      }
      long double Det = GJ(a, b);
      if (Det != 0) {
        ans[0].x = b[0];
        ans[0].y = b[1];
        ans[1].x = b[2];
        ans[1].y = b[3];
        ans[3].x = 2.0 * cc.x - 1.0 * ans[0].x;
        ans[3].y = 2.0 * cc.y - 1.0 * ans[0].y;
        ans[2].x = 2.0 * bb.x - 1.0 * ans[1].x;
        ans[2].y = 2.0 * bb.y - 1.0 * ans[1].y;
        chk = isConvex(ans) * (Det != 1e17);
        if (chk) {
          printf("YES\n");
          for (int cnt = 0; cnt < 4; cnt++)
            printf("%.9f %.9f ", ans[cnt].x, ans[cnt].y);
          printf("\n");
          break;
        }
      }
    }
    if (!chk) printf("NO\n\n");
  }
  return 0;
}