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;
};
struct Line {
  double A, B, C;
};
Line Build(Point A, Point B) {
  Line res;
  res.A = A.y - B.y;
  res.B = B.x - A.x;
  res.C = A.x * B.y - B.x * A.y;
  return res;
}
Line Per(Line l, Point A) {
  Line res;
  res.A = -l.B;
  res.B = l.A;
  res.C = -(res.A * A.x + res.B * A.y);
  return res;
}
Line Par(Line l, Point A) {
  Line res;
  res.A = l.A;
  res.B = l.B;
  res.C = -(l.A * A.x + l.B * A.y);
  return res;
}
Point Inter(Line a, Line b) {
  Point res;
  res.x = (a.B * b.C - b.B * a.C) / (a.A * b.B - b.A * a.B);
  res.y = (a.A * b.C - b.A * a.C) / (b.A * a.B - b.B * a.A);
  return res;
}
Point Middle(Point A, Point B) {
  Point res;
  res.x = (A.x + B.x) / 2.0;
  res.y = (A.y + B.y) / 2.0;
  return res;
}
double Dist(Point A, Point B) {
  double res = sqrt((A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y));
  return res;
}
double Dist2(Point A, Point B) {
  double res = (A.x - B.x) * (A.x - B.x) + (A.y - B.y) * (A.y - B.y);
  return res;
}
Point Mir(Point A, Point B) {
  Point res;
  res.x = B.x * 2 - A.x;
  res.y = B.y * 2 - A.y;
  return res;
}
double Cp2(Point A, Point B) {
  double res = A.x * B.y - A.y * B.x;
  return res;
}
double Cp3(Point O, Point A, Point B) {
  double res = (A.x - O.x) * (B.y - O.y) - (B.x - O.x) * (A.y - O.y);
  return res;
}
bool Zero(double x) { return (fabs(x) < 1e-9 ? true : false); }
Line Midper(Point A, Point B) {
  Line res = Per(Build(A, B), Middle(A, B));
  return res;
}
double Plos(Point A, Point B, Point C, Point D) {
  return fabs(A.x * B.y - A.y * B.x + B.x * C.y - B.y * C.x + C.x * D.y -
              C.y * D.x + D.x * A.y - D.y * A.x);
}
double Plos(Point A, Point B, Point C) {
  return fabs(A.x * B.y - A.y * B.x + B.x * C.y - B.y * C.x + C.x * A.y -
              C.y * A.x);
}
bool Check(Point ans[]) {
  double tmp;
  for (int i = 0; i < 4; i++) {
    if (Zero(Cp3(ans[i], ans[(i + 1) & 3], ans[(i + 2) & 3]))) return false;
  }
  if (!Zero(Plos(ans[0], ans[1], ans[2], ans[3]) -
            Plos(ans[0], ans[1], ans[2]) - Plos(ans[0], ans[2], ans[3])))
    return false;
  if (!Zero(Plos(ans[0], ans[1], ans[2], ans[3]) -
            Plos(ans[1], ans[2], ans[3]) - Plos(ans[1], ans[3], ans[0])))
    return false;
  return true;
}
void print(Line l) { printf("%.8fA + %.8fB + %.8fC = 0", l.A, l.B, l.C); }
void print(Point A) { printf("%.9f %.9f", A.x, A.y); }
bool Mak(Point A, Point B, Point C) {
  Line l1 = Midper(B, A);
  Line l2 = Midper(B, C);
  Point E = Inter(l1, l2);
  Point F = Mir(E, B);
  Point ans[4];
  ans[0] = Inter(Par(l2, F), l1);
  ans[1] = Mir(ans[0], B);
  ans[2] = Mir(ans[1], C);
  ans[3] = Mir(ans[0], A);
  if (Check(ans) == false) return false;
  puts("YES");
  for (int i = 3; i < 7; i++) {
    print(ans[i & 3]);
    putchar(i < 6 ? 32 : 10);
  }
  return true;
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    Point a, b, c;
    scanf("%lf%lf%lf%lf%lf%lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
    bool ff = false;
    if (Zero(Cp3(a, b, c)) == false) {
      if (!ff) ff = Mak(a, b, c);
      if (!ff) ff = Mak(a, c, b);
      if (!ff) ff = Mak(b, a, c);
      if (!ff) ff = Mak(b, c, a);
      if (!ff) ff = Mak(c, a, b);
      if (!ff) ff = Mak(c, b, a);
    }
    if (!ff) puts("NO\n");
  }
  return 0;
}