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;
};
struct line {
  double a, b, c;
};
const double EPS = 1e-9;
double det(double a, double b, double c, double d) { return a * d - c * b; }
bool intersect(line m, line n, pt &res) {
  double zn = det(m.a, m.b, n.a, n.b);
  if (abs(zn) < EPS) return false;
  res.x = -det(m.c, m.b, n.c, n.b) / zn;
  res.y = -det(m.a, m.c, n.a, n.c) / zn;
  return true;
}
bool parallel(line m, line n) { return abs(det(m.a, m.b, n.a, n.b)) < EPS; }
bool equivalent(line m, line n) {
  return abs(det(m.a, m.b, n.a, n.b)) < EPS &&
         abs(det(m.a, m.c, n.a, n.c)) < EPS &&
         abs(det(m.b, m.c, n.b, n.c)) < EPS;
}
line makeline(pt x, pt y, line &c) {
  double t, s;
  s = x.x - y.x;
  t = x.y - y.y;
  line a;
  a.a = t;
  a.b = (-1) * s;
  a.c = x.y * s - x.x * t;
  x.x = (x.x + y.x) / 2.00;
  x.y = (x.y + y.y) / 2.00;
  c.a = a.b * (-1);
  c.b = a.a;
  c.c = a.b * x.x - a.a * x.y;
  return a;
}
double distd(pt p, pt q) {
  double val = (q.y - p.y) * (q.y - p.y) + (q.x - p.x) * (q.x - p.x);
  val = (double)sqrt(val);
  return val;
}
int orientation(pt p, pt q, pt r) {
  double val = (q.y - p.y) * (r.x - q.x) - (q.x - p.x) * (r.y - q.y);
  if (val == 0) return 0;
  return (val > 0) ? 1 : 2;
}
double ang(pt B, pt A, pt C) {
  if (orientation(B, A, C) == 0) return 0;
  double a = distd(B, C);
  double b = distd(A, C);
  double c = distd(A, B);
  double t = (b * b + c * c - a * a) / (2.00 * b * c);
  t = acos(t);
  double pi = 2 * acos(0.0);
  t = (180.00 * t) / pi;
  return t;
}
int tetragon(pt k, pt l, pt m) {
  line a, b, c, d;
  pt B, A, C, D, m1;
  m1.x = 2 * l.x - m.x;
  m1.y = 2 * l.y - m.y;
  bool df;
  a = makeline(k, l, c);
  b = makeline(m1, l, d);
  df = intersect(c, d, B);
  if (df == 0) return -1;
  A.x = 2 * k.x - B.x;
  A.y = 2 * k.y - B.y;
  C.x = 2 * l.x - B.x;
  C.y = 2 * l.y - B.y;
  D.x = 2 * m.x - C.x;
  D.y = 2 * m.y - C.y;
  double d1, d2, d3, d4;
  int t1, t2, t3, t4;
  d1 = (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
  d2 = (C.x - B.x) * (C.x - B.x) + (C.y - B.y) * (C.y - B.y);
  d3 = (C.x - D.x) * (C.x - D.x) + (C.y - D.y) * (C.y - D.y);
  d4 = (A.x - D.x) * (A.x - D.x) + (A.y - D.y) * (A.y - D.y);
  t1 = orientation(A, B, C);
  t2 = orientation(B, C, D);
  t3 = orientation(C, D, A);
  t4 = orientation(D, A, B);
  if (t1 == 1 && t2 == 1 && t3 == 1 && t4 == 1) {
    printf("YES\n");
    printf("%0.9lf %0.9lf %0.9lf %0.9lf %0.9lf %0.9lf %0.9lf %0.9lf\n", A.x,
           A.y, B.x, B.y, C.x, C.y, D.x, D.y);
    return 1;
  } else
    return -1;
}
int main() {
  pt ar[3];
  int n, j;
  scanf("%d", &n);
  while (n--) {
    for (int i = 0; i < 3; i++) scanf("%lf%lf", &ar[i].x, &ar[i].y);
    j = tetragon(ar[0], ar[1], ar[2]);
    if (j == 1) continue;
    j = tetragon(ar[0], ar[2], ar[1]);
    if (j == 1) continue;
    j = tetragon(ar[1], ar[0], ar[2]);
    if (j == 1) continue;
    j = tetragon(ar[1], ar[2], ar[0]);
    if (j == 1) continue;
    j = tetragon(ar[2], ar[1], ar[0]);
    if (j == 1) continue;
    j = tetragon(ar[2], ar[0], ar[1]);
    if (j == 1) continue;
    printf("NO\n\n");
  }
  return 0;
}