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 int Debug = 1;
using namespace std;
template <class T>
void ckmin(T &a, T b) {
  if (a > b) {
    a = b;
  }
}
template <class T>
void ckmax(T &a, T b) {
  if (a < b) {
    a = b;
  }
}
int countbit(int n) { return n == 0 ? 0 : 1 + countbit(n & (n - 1)); }
const int maxint = 0x7fffffff;
const long long max64 = 0x7fffffffffffffffll;
const int N = 8;
const double eps = 1e-9;
int dcmp(double x) { return (x > eps) - (x < -eps); }
struct point_t {
  double x, y;
  point_t() {}
  point_t(double a, double b) { x = a, y = b; }
  double len() { return sqrt(x * x + y * y); }
  point_t turnLeft() { return point_t(-y, x); }
  point_t turnRight() { return point_t(y, -x); }
} p[N], ans[N];
point_t operator+(point_t a, point_t b) {
  return point_t(a.x + b.x, a.y + b.y);
}
point_t operator-(point_t a, point_t b) {
  return point_t(a.x - b.x, a.y - b.y);
}
point_t middle(point_t a, point_t b) {
  return point_t((a.x + b.x) / 2.0, (a.y + b.y) / 2.0);
}
double cross_mul(point_t a, point_t b) { return a.x * b.y - a.y * b.x; }
double dot_mul(point_t a, point_t b) { return a.x * b.x + a.y * b.y; }
point_t scale(point_t a, double fac) { return point_t(a.x * fac, a.y * fac); }
bool intersectLine(point_t s0, point_t s1, point_t t0, point_t t1, point_t &p) {
  point_t u = s1 - s0;
  point_t v = t1 - t0;
  point_t w = s0 - t0;
  if (0 == dcmp(dot_mul(u, v.turnLeft()))) {
    return false;
  }
  double s = -dot_mul(w, v.turnLeft()) / dot_mul(u, v.turnLeft());
  p = s0 + scale(u, s);
  return true;
}
bool proc(point_t a, point_t b, point_t c) {
  point_t t;
  if (cross_mul(a - b, c - b) > 0) {
    swap(a, c);
  }
  t = middle(b, c) + b - c;
  if (!intersectLine(t, t + (b - c).turnLeft(), middle(a, b),
                     middle(a, b) + (a - b).turnLeft(), ans[0])) {
    return false;
  }
  ans[1] = a + a - ans[0];
  ans[3] = b + b - ans[0];
  ans[2] = c + c - ans[3];
  for (int i = 0; i < 4; i++) {
    for (int j = 0; j < 4; j++) {
      if (i == j || (i + 1) % 4 == j) {
        continue;
      }
      if (cross_mul(ans[(i + 1) % 4] - ans[i], ans[j] - ans[i]) > -eps) {
        return false;
      }
    }
  }
  return true;
}
int main() {
  int i, j, k, testcase, a[3];
  scanf("%d", &testcase);
  while (testcase--) {
    for (i = 0; i < 3; i++) {
      a[i] = i;
      scanf("%lf %lf", &p[i].x, &p[i].y);
    }
    if (dcmp(cross_mul(p[1] - p[0], p[2] - p[0])) != 0 &&
        (proc(p[1], p[0], p[2]) || proc(p[0], p[1], p[2]) ||
         proc(p[0], p[2], p[1]))) {
      puts("YES");
      for (i = 0; i < 4; i++) {
        printf("%.9f %.9f ", ans[i].x, ans[i].y);
      }
      putchar(10);
    } else {
      puts("NO");
    }
  }
  return 0;
}