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;
const int MOD = 1000000007, dx[] = {0, 1, 0, -1}, dy[] = {1, 0, -1, 0};
const double eps = 1e-8, pi = acos(-1);
void read(int &k) {
  k = 0;
  char x = getchar();
  while (x < '0' || x > '9') x = getchar();
  while (x >= '0' && x <= '9') {
    k = k * 10 - 48 + x;
    x = getchar();
  }
}
struct point {
  double x, y, z;
  point() { z = 1; }
  point(double xx, double yy, double zz) {
    x = xx;
    y = yy;
    z = zz;
  }
  double operator*(point b) { return x * b.x + y * b.y + z * b.z; }
  point operator*(double k) { return (point){k * x, k * y, z}; }
  point operator/(point b) {
    return (point){y * b.z - z * b.y, z * b.x - x * b.z, x * b.y - y * b.x};
  }
  point operator-(point b) { return (point){x - b.x, y - b.y, z}; }
  point operator+(point b) { return (point){x + b.x, y + b.y, z}; }
  void rotate(double theta) {
    point T = *this;
    x = T.x * cos(theta) - T.y * sin(theta);
    y = T.x * sin(theta) + T.y * cos(theta);
  }
  void output() { printf("%.9lf %.9lf ", x, y); }
};
point V, P, WL, WR, ML, MR, dir, tP, tmp;
int cmp(double x, double y) {
  if (fabs(x - y) < eps) return 0;
  return x < y ? -1 : 1;
}
int inl(point x, point y, point z) { return cmp(x * (y / z), 0) == 0; }
point Normal(point y, point z) {
  point tmp = z - y;
  tmp.rotate(pi / 2);
  return tmp;
}
point Mirror(point x, point y, point z) {
  point nvec;
  nvec = Normal(y, z);
  point tmp = y / z, o, nxt;
  o = (point){tmp.y, -tmp.x, 0};
  o.z = -(x.x * o.x + x.y * o.y);
  nxt = o / tmp;
  nxt.x /= nxt.z;
  nxt.y /= nxt.z;
  nxt.z = 1;
  return nxt * 2 - x;
}
int in(point x, point y, point z) {
  int flag1 = 0, flag2 = 0;
  if (cmp(x.x, y.x) >= 0 && cmp(x.x, z.x) <= 0) flag1 = 1;
  if (cmp(x.x, z.x) >= 0 && cmp(x.x, y.x) <= 0) flag1 = 1;
  if (cmp(x.y, y.y) >= 0 && cmp(x.y, z.y) <= 0) flag2 = 1;
  if (cmp(x.y, z.y) >= 0 && cmp(x.y, y.y) <= 0) flag2 = 1;
  return flag1 & flag2;
}
int intersect(point x0, point y0, point x1, point y1, point &ret) {
  point l1, l2;
  l1 = x0 / y0;
  l2 = x1 / y1;
  ret = l1 / l2;
  if (cmp(ret.z, 0) == 0) return 0;
  ret.x /= ret.z;
  ret.y /= ret.z;
  ret.z = 1;
  return in(ret, x0, y0) && in(ret, x1, y1);
}
int cross(point x0, point y0, point x1, point y1) {
  if (inl(x1, x0, y0) && inl(y1, x0, y0))
    return in(x1, x0, y0) || in(y1, x0, y0) || in(x0, x1, y1) || in(y0, x1, y1);
  point a = y0 - x0;
  int flag1 = 0, flag2 = 0;
  if (cmp(((x1 - x0) / a).z * ((y1 - x0) / a).z, 0) <= 0) flag1 = 1;
  a = y1 - x1;
  if (cmp(((x0 - x1) / a).z * ((y0 - x1) / a).z, 0) <= 0) flag2 = 1;
  return flag1 & flag2;
}
int sgn(double x) { return cmp(x, 0); }
point midvectical(point x, point y) {
  point ret = x / y, z = (x + y) * 0.5;
  swap(ret.x, ret.y);
  ret.y = -ret.y;
  ret.z = -(z.x * ret.x + z.y * ret.y);
  return ret;
}
point a0, a1, a2, a3, a4, a5;
point l0, l1, l2, b1, b2, b3, b4;
int solve(point a0, point a1, point a2) {
  l0 = midvectical(a0, a1);
  l1 = midvectical(a0, a2);
  a3 = l0 / l1;
  a3.x /= a3.z;
  a3.y /= a3.z;
  a3.z = 1;
  l2 = l0;
  l2.z = -(l2.x * a0.x + l2.y * a0.y);
  a4 = l2 / l1;
  a4.x /= a4.z;
  a4.y /= a4.z;
  a4.z = 1;
  a5 = a4 * 2 - a3;
  b1 = a2 * 2 - a5;
  b2 = a5;
  b3 = a0 * 2 - a5;
  b4 = a1 * 2 - b3;
  if (inl(b1, b2, b3) || inl(b1, b2, b4) || inl(b1, b3, b4) || inl(b2, b3, b4))
    return 0;
  double dir = sgn(((b3 - b1) / (b2 - b1)).z);
  if (sgn(((b4 - b2) / (b3 - b2)).z) != dir) return 0;
  if (sgn(((b1 - b3) / (b4 - b3)).z) != dir) return 0;
  if (sgn(((b2 - b4) / (b1 - b4)).z) != dir) return 0;
  puts("YES");
  b1.output();
  b2.output();
  b3.output();
  b4.output();
  puts("");
  return 1;
}
int main() {
  int T;
  for (scanf("%d", &T); T--;) {
    scanf("%lf%lf%lf%lf%lf%lf", &a0.x, &a0.y, &a1.x, &a1.y, &a2.x, &a2.y);
    if (a0 * (a1 / a2) == 0) {
      puts("NO\n");
      continue;
    }
    if (solve(a0, a1, a2)) continue;
    if (solve(a0, a2, a1)) continue;
    if (solve(a1, a0, a2)) continue;
    if (solve(a1, a2, a0)) continue;
    if (solve(a2, a0, a1)) continue;
    if (solve(a2, a1, a0)) continue;
    puts("NO\n");
  }
  return 0;
}