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 INF = 1e8;
struct pto {
  double x, y;
  pto(double _x = 0, double _y = 0) : x(_x), y(_y) {}
  pto operator+(pto a) { return pto(x + a.x, y + a.y); }
  pto operator-(pto a) { return pto(x - a.x, y - a.y); }
  pto operator*(double a) { return pto(x * a, y * a); }
  double operator*(pto a) { return x * a.x + y * a.y; }
  double operator^(pto a) { return x * a.y - y * a.x; }
};
vector<vector<double>> mat(2, vector<double>(3));
int gauss(double a1, double a2, double b1, double b2, double c1, double c2,
          pair<double, double> &ans) {
  double det = b1 * a2 - b2 * a1;
  if (det < 1e-9) return 0;
  ans.first = (c1 * b2 - c2 * b1) / -det;
  ans.second = (c1 * a2 - c2 * a1) / det;
  return 1;
}
bool solve(double a1, double a2, double b1, double b2, double c1, double c2) {
  pto a(a1, a2);
  pto b(b1, b2);
  pto c(c1, c2);
  double gauss_a1 = -(b1 - a1);
  double gauss_b1 = a2 - b2;
  double gauss_c1 =
      (b2 / 2 + a2 / 2) * (a2 - b2) - (b1 / 2 + a1 / 2) * (b1 - a1);
  double gauss_a2 = (c1 - a1);
  double gauss_b2 = -(a2 - c2);
  double gauss_c2 = (c1 - a1) * (2 * a1 - c1 / 2 - a1 / 2) -
                    (a2 - c2) * (2 * a2 - c2 / 2 - a2 / 2);
  pair<double, double> ans;
  if (gauss(gauss_a1, gauss_a2, gauss_b1, gauss_b2, gauss_c1, gauss_c2, ans)) {
    pto p1(ans.first, ans.second);
    pto p2 = p1 + (a - p1) * 2.0;
    pto p3 = p2 + (c - p2) * 2.0;
    pto p4 = p1 + (b - p1) * 2.0;
    double angle1 = (p4 - p1) ^ (p2 - p1);
    double angle2 = (p1 - p2) ^ (p3 - p2);
    double angle3 = (p2 - p3) ^ (p4 - p3);
    double angle4 = (p3 - p4) ^ (p1 - p4);
    if (angle1 * angle2 > 0 and angle2 * angle3 > 0 and angle3 * angle4 > 0 and
        angle4 * angle1 > 0) {
      printf("YES\n");
      printf("%.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f\n", p1.x, p1.y, p2.x,
             p2.y, p3.x, p3.y, p4.x, p4.y);
      return true;
    } else {
    }
    return false;
  } else {
    return false;
  }
}
int main() {
  int n;
  scanf("%d", &n);
  double a1, a2, b1, b2, c1, c2;
  for (int i = (0); i < (n); i++) {
    scanf("%lf%lf%lf%lf%lf%lf", &a1, &a2, &b1, &b2, &c1, &c2);
    bool solved = false;
    if (!solved) solved = solve(a1, a2, b1, b2, c1, c2);
    if (!solved) solved = solve(a1, a2, c1, c2, b1, b2);
    if (!solved) solved = solve(c1, c2, a1, a2, b1, b2);
    if (!solved) solved = solve(c1, c2, b1, b2, a1, a2);
    if (!solved) solved = solve(b1, b2, c1, c2, a1, a2);
    if (!solved) solved = solve(b1, b2, a1, a2, c1, c2);
    if (!solved) printf("NO\n\n");
  }
}