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 pa {
  double x, y;
} a, b, c, an[4];
const double zero = 0.00001;
int i, tt;
double cha(pa x, pa y, pa z) {
  return ((y.x - x.x) * (z.y - y.y) - (y.y - x.y) * (z.x - y.x));
}
bool work(pa x, pa y, pa z, pa d) {
  int f1 = 0, f2 = 0;
  double aa, bb;
  aa = cha(x, y, z);
  bb = cha(y, z, d);
  if (cha(x, y, z) + 0.00001 > 0) f1 = 1;
  if (cha(y, z, d) + 0.00001 > 0) f2 = 1;
  if ((f1 ^ f2) == 0)
    return (true);
  else
    return false;
}
bool check(pa x, pa y, pa z) {
  if ((abs(cha(x, y, z))) < zero) {
    return (0);
  }
  pa xx, yy, zz, tmp;
  xx.x = y.x * 2 - x.x;
  xx.y = y.y * 2 - x.y;
  yy = y;
  zz = z;
  if (abs(xx.y - yy.y) < zero)
    tmp = xx, xx = zz, zz = tmp;
  else if (abs(xx.y - zz.y) < zero)
    tmp = xx, xx = yy, yy = tmp;
  double a1, a2, b1, b2, dis, dis2;
  a1 = (zz.x - xx.x) / (xx.y - zz.y);
  a2 = (xx.x * xx.x + xx.y * xx.y - zz.x * zz.x - zz.y * zz.y) /
       (2 * xx.y - 2 * zz.y);
  b1 = (yy.x - xx.x) / (xx.y - yy.y);
  b2 = (xx.x * xx.x + xx.y * xx.y - yy.x * yy.x - yy.y * yy.y) /
       (2 * xx.y - 2 * yy.y);
  an[2].x = (a2 - b2) / (b1 - a1);
  an[2].y = an[2].x * a1 + a2;
  an[1].x = 2 * y.x - an[2].x;
  an[1].y = 2 * y.y - an[2].y;
  an[3].x = 2 * z.x - an[2].x;
  an[3].y = 2 * z.y - an[2].y;
  dis = sqrt((an[2].y - y.y) * (an[2].y - y.y) +
             (an[2].x - y.x) * (an[2].x - y.x));
  dis2 = sqrt((an[3].y - x.y) * (an[3].y - x.y) +
              (an[3].x - x.x) * (an[3].x - x.x));
  if (abs(dis - dis2) < zero) {
    an[0].x = 2 * x.x - an[3].x;
    an[0].y = 2 * x.y - an[3].y;
  } else {
    an[0].x = 2 * x.x - an[1].x;
    an[0].y = 2 * x.y - an[1].y;
  }
  for (i = 0; i <= 3; i++) {
    if (!(work(an[i], an[(i + 1) % 4], an[(i + 2) % 4], an[(i + 3) % 4]))) {
      return (0);
    }
    if (abs(cha(an[i], an[(i + 1) % 4], an[(i + 2) % 4])) < zero) {
      return (0);
    }
  }
  printf("YES\n%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", an[0].x,
         an[0].y, an[1].x, an[1].y, an[2].x, an[2].y, an[3].x, an[3].y);
  return 1;
}
int main() {
  scanf("%d", &tt);
  for (; tt--;) {
    scanf("%lf%lf%lf%lf%lf%lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
    if (!(check(a, b, c) || check(b, a, c) || check(c, a, b) ||
          check(a, c, b) || check(b, c, a) || check(c, b, a)))
      printf("NO\n\n");
  }
}