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 pt {
  double x, y;
};
double dist(pt a, pt b) {
  return sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y));
}
struct line {
  double a, b, c;
};
pt a[4];
line drline(pt a, pt b) {
  line ret;
  ret.a = a.y - b.y;
  ret.b = b.x - a.x;
  ret.c = a.x * b.y - a.y * b.x;
  return ret;
}
line prline(line l, pt a) {
  line ret;
  ret.a = -l.b;
  ret.b = l.a;
  ret.c = -ret.a * a.x - ret.b * a.y;
  return ret;
}
pt intersect(line l1, line l2) {
  double d = l1.a * l2.b - l1.b * l2.a;
  double d1 = -l1.c * l2.b - l1.b * (-l2.c);
  double d2 = l1.a * (-l2.c) - (-l1.c) * l2.a;
  pt ret;
  ret.x = d1 / d;
  ret.y = d2 / d;
  return ret;
}
line par(line l1, pt a) {
  line ret;
  ret.a = l1.a;
  ret.b = l1.b;
  ret.c = -ret.a * a.x - ret.b * a.y;
  return ret;
}
pt ser(pt a, pt b) {
  pt ret;
  ret.x = (a.x + b.x) / 2;
  ret.y = (a.y + b.y) / 2;
  return ret;
}
pt sym(pt a, pt b) {
  pt ret;
  ret.x = 2 * b.x - a.x;
  ret.y = 2 * b.y - a.y;
  return ret;
}
double plos(pt a, pt b, pt c, pt d) {
  double ret;
  ret = fabs(a.x * b.y - b.x * a.y + b.x * c.y - b.y * c.x + c.x * d.y -
             c.y * d.x + d.x * a.y - d.y * a.x);
  ret /= 2.0;
  return ret;
}
double plos2(pt a, pt b, pt c) {
  double ret;
  ret = fabs(a.x * b.y - b.x * a.y + b.x * c.y - b.y * c.x + c.x * a.y -
             c.y * a.x);
  ret /= 2.0;
  return ret;
}
int ln(pt a, pt b, pt c) {
  double A = dist(a, b), B = dist(a, c), C = dist(b, c);
  if (fabs(A + B - C) < 1e-9 || fabs(A + C - B) < 1e-9 ||
      fabs(B + C - A) < 1e-9)
    return 1;
  return 0;
}
int gd(pt a, pt b, pt c) {
  line l1 = prline(drline(a, b), ser(a, b));
  line l2 = prline(drline(b, c), ser(b, c));
  pt d = intersect(l1, l2);
  d = sym(d, b);
  line l3 = par(l2, d);
  pt f = intersect(l3, l1);
  pt a1, a2, a3, a4;
  a2 = f;
  a1 = sym(a2, a);
  a3 = sym(a2, b);
  a4 = sym(a3, c);
  if (fabs(plos(a1, a2, a3, a4) - plos2(a1, a2, a3) - plos2(a1, a3, a4)) > 1e-9)
    return 0;
  if (fabs(plos(a1, a2, a3, a4) - plos2(a2, a3, a4) - plos2(a2, a1, a4)) > 1e-9)
    return 0;
  if (fabs(plos(a1, a2, a3, a4) - plos2(a3, a1, a4) - plos2(a3, a1, a2)) > 1e-9)
    return 0;
  if (fabs(plos(a1, a2, a3, a4) - plos2(a4, a1, a2) - plos2(a4, a2, a3)) > 1e-9)
    return 0;
  if (ln(a1, a2, a3)) return 0;
  if (ln(a1, a2, a4)) return 0;
  if (ln(a1, a3, a4)) return 0;
  if (ln(a2, a3, a4)) return 0;
  printf("YES\n");
  printf("%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", a1.x, a1.y, a2.x,
         a2.y, a3.x, a3.y, a4.x, a4.y);
  return 1;
}
void solve() {
  scanf("%lf%lf%lf%lf%lf%lf", &a[1].x, &a[1].y, &a[2].x, &a[2].y, &a[3].x,
        &a[3].y);
  double A = dist(a[1], a[2]), B = dist(a[1], a[3]), C = dist(a[2], a[3]);
  if (fabs(A + B - C) < 1e-9 || fabs(A + C - B) < 1e-9 ||
      fabs(B + C - A) < 1e-9) {
    printf("NO\n");
    printf("\n");
    return;
  }
  if (gd(a[1], a[2], a[3])) return;
  if (gd(a[1], a[3], a[2])) return;
  if (gd(a[2], a[1], a[3])) return;
  if (gd(a[2], a[3], a[1])) return;
  if (gd(a[3], a[1], a[2])) return;
  if (gd(a[3], a[2], a[1])) return;
  printf("NO\n");
  printf("\n");
}
int main() {
  int t;
  scanf("%d", &t);
  for (int i = 0; i < t; i++) solve();
  return 0;
}