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>
struct P {
  double x, y;
  P() {}
  P(double x, double y) : x(x), y(y) {}
  P operator-(const P& b) { return P(x - b.x, y - b.y); }
  double operator*(const P& b) { return x * b.y - y * b.x; }
} pt[3], st[6];
int sgn(double a) { return a < -1e-8 ? -1 : a > 1e-8; }
int judge() {
  double p[4];
  st[4] = st[0], st[5] = st[1];
  for (int i = 0; i < 4; i++)
    p[i] = (st[i + 2] - st[i + 1]) * (st[i + 1] - st[i]);
  for (int i = 0; i < 3; i++) {
    if (sgn(p[i] * p[i + 1]) <= 0) return 0;
  }
  return 1;
}
int main() {
  int n;
  scanf("%d", &n);
  while (n--) {
    for (int i = 0; i < 3; i++) scanf("%lf%lf", &pt[i].x, &pt[i].y);
    pt[3] = pt[0], pt[4] = pt[1];
    double v = (pt[1] - pt[0]) * (pt[2] - pt[0]);
    if (sgn(v) == 0) {
      puts("NO\n");
    } else {
      int flag = 0;
      for (int i = 0; i < 3; i++) {
        P a = pt[i], b = pt[i + 1], c = pt[i + 2];
        double A1 = (a.x - b.x);
        double B1 = (a.y - b.y);
        double C1 = -(a.x + b.x) / 2 * A1 - (a.y + b.y) / 2 * B1;
        double A2 = (c.x - b.x);
        double B2 = (c.y - b.y);
        double C2 =
            ((b.x + c.x) / 2 - 2 * b.x) * A2 + ((b.y + c.y) / 2 - 2 * b.y) * B2;
        double v = A2 * B1 - A1 * B2;
        if (sgn(v) == 0) continue;
        P ret;
        ret.x = (C1 * B2 - C2 * B1) / v;
        ret.y = (A1 * C2 - A2 * C1) / v;
        st[0] = ret;
        st[1] = P(2 * b.x - ret.x, 2 * b.y - ret.y);
        st[2] = P(2 * c.x - st[1].x, 2 * c.y - st[1].y);
        st[3] = P(2 * a.x - ret.x, 2 * a.y - ret.y);
        if (judge()) {
          flag = 1;
          break;
        }
      }
      if (flag) {
        puts("YES");
        for (int i = 0; i < 4; i++) {
          printf("%.9f %.9f", st[i].x, st[i].y);
          if (i == 3)
            puts("");
          else
            printf(" ");
        }
      } else
        puts("NO\n");
    }
  }
}