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 {
  long double x, y;
  Point(long double x = 0., long double y = 0.) : x(x), y(y) {}
  Point operator+(Point p) { return Point(x + p.x, y + p.y); }
  Point operator-(Point p) { return Point(x - p.x, y - p.y); }
  long double operator^(Point p) { return x * p.y - y * p.x; }
  long double operator*(Point p) { return x * p.x + y * p.y; }
  Point operator/(long double c) { return Point(x / c, y / c); }
  Point operator*(long double c) { return Point(c * x, c * y); }
  friend Point operator*(long double c, Point p) { return p * c; }
  Point perp() { return Point(-y, x); }
  friend long double abs(Point p) { return p * p; }
};
int main() {
  int t;
  cin >> t;
  while (t--) {
    Point P[3];
    for (int i = 0; i < 3; ++i) {
      scanf("%Lf %Lf", &P[i].x, &P[i].y);
    }
    long double diA = abs((P[1] - P[0]) ^ (P[2] - P[0]));
    if (abs(diA) < 1e-10) {
      puts("NO\n");
      continue;
    }
    bool ok = 0;
    Point D[4];
    int sign = 1;
    for (int d = -1; d <= 1; d += 2) {
      for (int i = 0; i < 3; ++i) {
        Point A = P[i];
        Point B = P[(i + 1) % 3];
        Point C = P[(i + 2) % 3];
        D[0] = (A + B) / 2 + d * (B - A).perp() *
                                 (3 * abs(C - A) + abs(B - A) - abs(C - B)) /
                                 4 / diA;
        D[1] = 2 * B - D[0];
        D[2] = 2 * C - 2 * A + D[0];
        D[3] = 2 * A - D[0];
        long double a = abs(D[0] - D[1]);
        long double b = abs(D[0] - D[3]);
        long double c = abs(D[2] - D[3]);
        if (abs(a - b) > 1e-8 or abs(a - c) > 1e-8) continue;
        ok = 1;
        for (int j = 0; j < 4; ++j) {
          int cur = 1;
          if (((D[(j + 1) % 4] - D[j]) ^ (D[(j + 2) % 4] - D[j])) < 0) {
            cur = -1;
          }
          if (((D[(j + 1) % 4] - D[j]) ^ (D[(j + 2) % 4] - D[j])) == 0) {
            ok = 0;
          }
          if (j) {
            if (sign != cur) ok = 0;
          } else
            sign = cur;
        }
        if (ok) break;
      }
      if (ok) break;
    }
    puts(ok ? "YES" : "NO");
    cout << fixed << setprecision(9);
    if (ok) {
      if (sign == 1)
        for (int i = 0; i < 4; ++i) {
          cout << D[i].x << " " << D[i].y << " ";
        }
      else
        for (int i = 3; i >= 0; --i) {
          cout << D[i].x << " " << D[i].y << " ";
        }
    }
    cout << endl;
  }
  return 0;
}