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;
  point() { x = y = 0; }
  point(double xx, double yy) {
    x = xx;
    y = yy;
  }
} p[3], ans[4], w[4];
int top;
double dist(point a, point b) {
  return hypot(fabs(a.x - b.x), fabs(a.y - b.y));
}
double Mul(point a, point b, point c) {
  return (b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x);
}
int cmp(const void *a, const void *b) {
  point c = *(point *)a;
  point d = *(point *)b;
  double k = Mul(ans[0], c, d);
  if (k < 0 || (!k && dist(c, ans[0]) > dist(d, ans[0]))) return 1;
  return -1;
}
void con() {
  int i;
  int n = 4;
  for (i = 1; i < n; i++) {
    point temp;
    if (ans[i].y < ans[0].y || (ans[i].y == ans[0].y && ans[i].x < ans[0].x)) {
      temp = ans[i];
      ans[i] = ans[0];
      ans[0] = temp;
    }
  }
  qsort(ans + 1, n - 1, sizeof(ans[0]), cmp);
  w[0] = ans[0];
  w[1] = ans[1];
  w[2] = ans[2];
  top = 2;
  for (i = 3; i < n; i++) {
    while (top >= 2 && Mul(w[top - 1], w[top], ans[i]) <= 0) top--;
    top++;
    w[top] = ans[i];
  }
}
bool TB() {
  top = 0;
  con();
  int i, j, k;
  if (top == 3) {
    for (i = 0; i <= 3; i++) {
      for (j = 0; j <= 3; j++) {
        for (k = 0; k <= 3; k++) {
          if (i == j || i == k || j == k) continue;
          if (fabs((w[j].y - w[i].y) * (w[j].x - w[k].x) -
                   (w[j].y - w[k].y) * (w[j].x - w[i].x)) < 1e-8)
            return 0;
        }
      }
    }
    double dis[5];
    for (i = 0; i < 4; i++) dis[i] = dist(w[i], w[(i + 1) % 4]);
    sort(dis, dis + 4);
    int tp1 = 0, tp2 = 0;
    for (i = 0; i < 4; i++) {
      if (fabs(dis[i] - dis[0]) < 1e-8) tp1++;
      if (fabs(dis[i] - dis[3]) < 1e-8) tp2++;
    }
    if (tp1 >= 3 || tp2 >= 3) return 1;
    return 0;
  }
  return 0;
}
int solve(point b, point a, point c) {
  double k1, k2;
  point d = point((a.x + b.x) / 2, (a.y + b.y) / 2);
  point e = point((c.x + b.x) / 2, (c.y + b.y) / 2);
  if (fabs(a.y - b.y) < 1e-8) {
    if (fabs(c.y - b.y) < 1e-8)
      return 0;
    else {
      k2 = -(c.x - b.x) / (c.y - b.y);
      double uy = -(k2 * (2 * b.x - d.x - e.x) + e.y - 2 * b.y);
      ans[0] = point(d.x, uy);
      ans[1] = point(2 * b.x - d.x, 2 * b.y - uy);
      ans[2] = point(2 * c.x - ans[1].x, 2 * c.y - ans[1].y);
      ans[3] = point(2 * a.x - ans[0].x, 2 * a.y - ans[0].y);
      return TB();
    }
  } else {
    k1 = -(a.x - b.x) / (a.y - b.y);
    if (fabs(c.y - b.y) < 1e-8) {
      double ux = 2 * b.x - e.x;
      ans[0] = point(ux, k1 * (ux - d.x) + d.y);
      ans[1] = point(2 * b.x - ux, 2 * b.y - k1 * (ux - d.x) - d.y);
      ans[2] = point(2 * c.x - ans[1].x, 2 * c.y - ans[1].y);
      ans[3] = point(2 * a.x - ans[0].x, 2 * a.y - ans[0].y);
      return TB();
    } else {
      k2 = -(c.x - b.x) / (c.y - b.y);
      if (fabs(k1 - k2) < 1e-8) return 0;
      double ux = -k1 * d.x + 2 * k2 * b.x - k2 * e.x + e.y + d.y - 2 * b.y;
      ux /= (k2 - k1);
      ans[0] = point(ux, k1 * (ux - d.x) + d.y);
      ans[1] = point(2 * b.x - ux, 2 * b.y - k1 * (ux - d.x) - d.y);
      ans[2] = point(2 * c.x - ans[1].x, 2 * c.y - ans[1].y);
      ans[3] = point(2 * a.x - ans[0].x, 2 * a.y - ans[0].y);
      return TB();
    }
  }
}
int main() {
  int T, i, flag;
  point a, b, c;
  scanf("%d", &T);
  while (T--) {
    for (i = 0; i < 3; i++) scanf("%lf%lf", &p[i].x, &p[i].y);
    flag = 0;
    for (i = 0; i < 3; i++) {
      b = p[i];
      a = p[(i + 1) % 3];
      c = p[(i + 2) % 3];
      if (solve(b, a, c)) {
        flag = 1;
        break;
      }
    }
    if (flag) {
      printf("YES\n");
      for (i = 0; i < 4; i++) printf("%.10f %.10f ", w[i].x, w[i].y);
      printf("\n");
    } else
      printf("NO\n\n");
  }
  return 0;
}