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() {}
  point(double x, double y) : x(x), y(y) {}
  point rt90() { return point(y, -x); }
};
int fsgn(double x) {
  if (fabs(x) < 1e-10)
    return 0;
  else if (x > 0)
    return 1;
  else
    return -1;
}
point operator+(point a, point b) { return point(a.x + b.x, a.y + b.y); }
point operator-(point a, point b) { return point(a.x - b.x, a.y - b.y); }
point operator*(point a, double b) { return point(a.x * b, a.y * b); }
double operator*(point a, point b) { return a.x * b.y - a.y * b.x; }
struct line {
  double a, b, c;
  line() {}
  line(point p, point q) {
    a = q.y - p.y;
    b = -(q.x - p.x);
    c = -a * p.x - b * p.y;
  }
};
int checkconvex(point *p) {
  int t[3] = {0, 0, 0};
  int *vis = t + 1;
  for (int i = (1); i <= (4); i++)
    vis[fsgn((p[i] - p[i - 1]) * (p[i + 1] - p[i - 1]))] = 1;
  if (vis[0]) return 0;
  if (vis[1] && vis[-1]) return 0;
  return 1;
}
int check(point a, point b, point c) {
  line L1 = line((a + b) * 0.5, ((a + b) * 0.5) + (b - a).rt90());
  line L2 = line((c + b) * 0.5, ((c + b) * 0.5) + (c - b).rt90());
  line L3;
  L3.a = -L2.a;
  L3.b = -L2.b;
  L3.c = L2.c + L2.a * b.x * 2 + L2.b * b.y * 2;
  swap(L2, L3);
  if (fabs(L1.a) < 1e-10 && fabs(L1.b) < 1e-10) return 0;
  if (fabs(L2.a) < 1e-10 && fabs(L2.b) < 1e-10) return 0;
  point p;
  if (fabs(L1.a) < 1e-10 && fabs(L2.a) < 1e-10) return 0;
  if (fabs(L1.a) < 1e-10) {
    p.y = -L1.c / L1.b;
    p.x = -(L2.c + p.y * L2.b) / L2.a;
  } else if (fabs(L2.a) < 1e-10) {
    p.y = -L2.c / L2.b;
    p.x = -(L1.c + p.y * L1.b) / L1.a;
  } else {
    double c1 = L1.b * L2.a - L1.a * L2.b, c2 = L1.c * L2.a - L2.c * L1.a;
    if (fabs(c1) < 1e-10) return 0;
    p.y = -c2 / c1;
    p.x = -(L1.c + L1.b * p.y) / L1.a;
  }
  point res[6];
  res[0] = a * 2 - p;
  res[1] = p;
  res[2] = b * 2 - p;
  res[3] = c * 2 - res[2];
  res[4] = res[0];
  res[5] = res[1];
  if (checkconvex(res)) {
    printf("YES\n");
    for (int i = (0); i <= (3); i++)
      printf("%.16lf %.16lf ", res[i].x, res[i].y);
    printf("\n");
    return 1;
  }
  return 0;
}
void lemon() {
  point a, b, c;
  cin >> a.x >> a.y >> b.x >> b.y >> c.x >> c.y;
  if (check(a, b, c)) return;
  if (check(b, a, c)) return;
  if (check(a, c, b)) return;
  printf("NO\n\n");
}
int main() {
  ios::sync_with_stdio(true);
  int tcase;
  scanf("%d", &tcase);
  while (tcase--) lemon();
  return 0;
}