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 double PI = acos(-1.0);
const double EPS = 1e-8;
int sgn(double a, double b = 0) { return a - b < -EPS ? -1 : a - b > EPS; }
struct Point {
  double x, y;
  Point(double x = 0, double y = 0) : x(x), y(y) {}
  Point sym(Point o) { return Point(x * 2.0 - o.x, y * 2.0 - o.y); }
  Point rotate(double angle = PI / 2.0) {
    double tx = cos(angle) * x - sin(angle) * y;
    double ty = sin(angle) * x + cos(angle) * y;
    return Point(tx, ty);
  }
  double size() { return sqrt(x * x + y * y); }
  void show() { cout << x << ' ' << y << endl; }
};
struct Line {
  double a, b, c;
  Line() {}
  Line(Point v, Point p) {
    a = -v.y;
    b = v.x;
    c = -(a * p.x + b * p.y);
  }
};
Point operator+(const Point &a, const Point &b) {
  return Point(a.x + b.x, a.y + b.y);
}
Point operator-(const Point &a, const Point &b) {
  return Point(a.x - b.x, a.y - b.y);
}
Point operator/(const Point &a, double x) { return Point(a.x / x, a.y / x); }
double det(const Point &p1, const Point &p2) {
  return p1.x * p2.y - p2.x * p1.y;
}
double dot(const Point &p1, const Point &p2) {
  return p1.x * p2.x + p1.y * p2.y;
}
vector<Point> solve(Point K, Point L, Point M) {
  M = L.sym(M);
  Line l1(Point(L - M).rotate(), (L + M) / 2.0);
  Line l2(Point(K - L).rotate(), (K + L) / 2.0);
  double d = det(Point(l1.a, l1.b), Point(l2.a, l2.b));
  if (sgn(d) == 0) return vector<Point>();
  double dx = det(Point(-l1.c, l1.b), Point(-l2.c, l2.b));
  double dy = det(Point(l1.a, -l1.c), Point(l2.a, -l2.c));
  Point B = Point(dx / d, dy / d);
  Point A = K.sym(B);
  Point C = L.sym(B);
  Point D = (L.sym(M)).sym(C);
  vector<Point> v;
  v.push_back(A);
  v.push_back(B);
  v.push_back(C);
  v.push_back(D);
  int prev = sgn(det(v[0] - v[3], v[1] - v[0]));
  for (int i = 2; i <= 4; ++i) {
    int now = sgn(det(v[i - 1] - v[i - 2], v[i % 4] - v[i - 1]));
    if (now != prev || prev == 0) return vector<Point>();
  }
  return v;
}
int main() {
  int tests;
  scanf("%d", &tests);
  Point v[3];
  while (tests--) {
    for (int i = 0; i < 3; ++i) scanf("%lf%lf", &v[i].x, &v[i].y);
    vector<Point> res;
    for (int i = 0; i < 3; ++i) {
      res = solve(v[i], v[(i + 1) % 3], v[(i + 2) % 3]);
      if (res.size()) break;
    }
    puts(res.size() ? "YES" : "NO");
    if (res.size()) {
      for (int i = 0; i < 4; ++i)
        printf("%.9f %.9f%c", res[i].x, res[i].y, i < 3 ? ' ' : '\n');
    } else {
      puts("");
    }
  }
}