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;
}
bool Check(Point ans[]) {
  double tmp;
  for (int i = 0; i < 4; i++) {
    if (Zero(Cp3(ans[i], ans[(i + 1) % 4], ans[(i + 2) % 4]))) return false;
    if (i == 0)
      tmp = Cp3(ans[i], ans[(i + 1) % 4], ans[(i + 2) % 4]);
    else if (tmp * Cp3(ans[i], ans[(i + 1) % 4], ans[(i + 2) % 4]) < 0)
      return false;
  }
  return true;
}
bool Mak(Point A, Point B, Point C) {
  if (Cp3(A, B, C) > 1e-9) swap(B, 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++) {
    printf("%.9f %.9f", ans[i & 3].x, ans[i & 3].y);
    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);
    if (!Zero(Cp3(a, b, c)) && (Mak(a, b, c) || Mak(b, c, a) || Mak(c, a, b)))
      continue;
    puts("NO\n");
  }
  return 0;
}