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;
using namespace rel_ops;
const double EPS = 1e-12, MAGIC = 2.71828e18;
inline double sqr(double a) { return a * a; }
inline double cmp(double a, double b) {
  return fabs(a - b) >= EPS + fabs(a) * EPS ? a - b : 0;
}
struct VEC {
  double x, y;
} NOVEC = {MAGIC, MAGIC};
struct RAY {
  VEC u, v;
} NORAY = {NOVEC, NOVEC};
struct CIR {
  VEC u;
  double r;
} NOCIR = {NOVEC, MAGIC};
inline double sqr(const VEC& a) { return sqr(a.x) + sqr(a.y); }
inline double abs(const VEC& a) { return sqrt(sqr(a)); }
inline double cmp(const VEC& a, const VEC& b) {
  double at = cmp(a.x, b.x);
  return !at ? cmp(a.y, b.y) : at;
}
inline VEC operator+(const VEC& a, const VEC& b) {
  return (VEC){a.x + b.x, a.y + b.y};
}
inline VEC operator-(const VEC& a, const VEC& b) {
  return (VEC){a.x - b.x, a.y - b.y};
}
inline double operator*(const VEC& a, const VEC& b) {
  return a.x * b.y - a.y * b.x;
}
inline double operator%(const VEC& a, const VEC& b) {
  return a.x * b.x + a.y * b.y;
}
inline VEC operator-(const VEC& a) { return (VEC){-a.x, -a.y}; }
inline VEC operator~(const VEC& a) { return (VEC){-a.y, +a.x}; }
inline VEC operator*(double u, const VEC& a) { return (VEC){u * a.x, u * a.y}; }
inline VEC operator*(const VEC& a, double u) { return (VEC){a.x * u, a.y * u}; }
inline VEC operator/(const VEC& a, double u) { return (VEC){a.x / u, a.y / u}; }
inline VEC operator/(const VEC& a, const VEC& b) { return a % b / sqr(b) * b; }
inline bool operator==(const VEC& a, const VEC& b) { return !cmp(a, b); }
inline bool operator<(const VEC& a, const VEC& b) { return cmp(a, b) < 0; }
double cmp_side(const VEC& a, const VEC& b) {
  return cmp(a.x * b.y, +a.y * b.x);
}
double cmp_axis(const VEC& a, const VEC& b) {
  return cmp(a.x * b.x, -a.y * b.y);
}
CIR make_circle(const VEC& a, const VEC& b, const VEC& c) {
  if (!cmp_side(a - b, a - c)) return NOCIR;
  double x = (c - b) % (a - c), y = (c - b) * (a - b);
  VEC m = (x / y * ~(a - b) + a + b) / 2;
  return (CIR){m, abs(a - m)};
}
int main() {
  int cs, t;
  scanf("%d", &cs);
  while (cs--) {
    VEC a[3], u[4];
    for (t = 0; t < 3; t++) scanf("%lf%lf", &a[t].x, &a[t].y);
    for (t = 0; t < 3; t++) {
      CIR c = make_circle(2 * a[1] - a[2], a[0], a[1]);
      if (c.u != NOVEC) {
        u[0] = a[0] * 2 - c.u;
        u[1] = c.u;
        u[2] = a[1] * 2 - c.u;
        u[3] = c.u + (a[2] - a[1]) * 2;
        int cnt[3] = {};
        for (int i = 0; i < 4; i++) {
          double o = cmp_side(u[(i + 2) % 4] - u[i], u[(i + 1) % 4] - u[i]);
          cnt[o <= 0 ? o ? 0 : 1 : 2]++;
        }
        if (cnt[1] + cnt[0] * cnt[2] == 0) break;
      }
      rotate(a, a + 1, a + 3);
    }
    if (t == 3)
      puts("NO");
    else {
      puts("YES");
      for (int i = 0; i < 4; i++) printf("%.9f %.9f ", u[i].x, u[i].y);
    }
    puts("");
  }
}