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>
const double eps = 1e-10;
struct pt {
  double x, y;
  pt() {}
  pt(double _x, double _y) : x(_x), y(_y) {}
};
struct line {
  int A, B;
  double C;
  line() {}
  line(int _A, int _B, double _x, double _y)
      : A(_A), B(_B), C(-_A * _x - _B * _y) {}
};
pt p[3];
int pr[3];
bool used[3];
inline double cross(const pt &p0, const pt &p1, const pt &p2) {
  return (p1.x - p0.x) * (p2.y - p0.y) - (p2.x - p0.x) * (p1.y - p0.y);
}
pt intersect(const line &l1, const line &l2) {
  int div = (l1.A * l2.B - l2.A * l1.B);
  double x0, y0;
  if (div == 0) {
    if (l1.B == 0)
      return pt(-l1.C / l1.A, -l2.C / l2.B);
    else
      return pt(-l2.C / l2.A, -l1.C / l1.B);
  } else {
    x0 = (l2.C * l1.B - l1.C * l2.B) / div;
    if (l1.B == 0)
      y0 = (-l2.C - l2.A * x0) / l2.B;
    else
      y0 = (-l1.C - l1.A * x0) / l1.B;
    return pt(x0, y0);
  }
}
bool convex(const pt &A, const pt &B, const pt &C, const pt &D) {
  double c1(cross(A, B, C)), c2(cross(B, C, D)), c3(cross(C, D, A)),
      c4(cross(D, A, B));
  return (c1 > eps && c2 > eps && c3 > eps && c4 > eps) ||
         (c1 < -eps && c2 < -eps && c3 < -eps && c4 < -eps);
}
bool check() {
  pt &K = p[pr[0]], &L = p[pr[1]], &M = p[pr[2]],
     Mp(L.x + L.x - M.x, L.y + L.y - M.y);
  if (fabs(cross(K, L, Mp)) < eps) return false;
  line l1(L.x - K.x, L.y - K.y, (L.x + K.x) * 0.5, (L.y + K.y) * 0.5),
      l2(Mp.x - K.x, Mp.y - K.y, (Mp.x + K.x) * 0.5, (Mp.y + K.y) * 0.5);
  pt A(intersect(l1, l2)), B(K.x + K.x - A.x, K.y + K.y - A.y),
      D(L.x + L.x - A.x, L.y + L.y - A.y), C(M.x + M.x - D.x, M.y + M.y - D.y);
  if (convex(A, B, C, D)) {
    printf("YES\n%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", A.x, A.y,
           B.x, B.y, C.x, C.y, D.x, D.y);
    return true;
  }
  return false;
}
bool dfs(int i) {
  if (i == 3) return check();
  for (int j = 0; j < 3; ++j)
    if (!used[j]) {
      used[j] = true;
      pr[i] = j;
      if (dfs(i + 1)) return true;
      used[j] = false;
    }
  return false;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    for (int i = 0; i < 3; ++i)
      scanf("%lf%lf", &p[i].x, &p[i].y), used[i] = false;
    if (!dfs(0)) printf("NO\n\n");
  }
  return 0;
}