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>
const double eps = 1e-7, pi = acos(-1);
bool equal(double a, double b) { return a - b > -eps && a - b < eps; }
bool less(double a, double b) { return a - b < -eps; }
bool leq(double a, double b) { return a - b < eps; }
bool greater(double a, double b) { return a - b > eps; }
bool geq(double a, double b) { return a - b > -eps; }
double sqr(double x) { return x * x; }
struct point {
  double x, y;
  explicit point(double x_ = 0.0, double y_ = 0.0) : x(x_), y(y_) {}
  friend bool operator==(point a, point b) {
    return equal(a.x, b.x) && equal(a.y, b.y);
  }
  friend point operator+(point a, point b) {
    return point(a.x + b.x, a.y + b.y);
  }
  friend point operator-(point a, point b) {
    return point(a.x - b.x, a.y - b.y);
  }
  friend point operator*(point a, double b) { return point(a.x * b, a.y * b); }
  friend point operator/(point a, double b) { return point(a.x / b, a.y / b); }
};
double dist(point a, point b) { return sqrt(sqr(a.x - b.x) + sqr(a.y - b.y)); }
struct vec : public point {
  explicit vec(double x_ = 0.0, double y_ = 0.0) { x = x_, y = y_; }
  explicit vec(double len, double rad, bool type) {
    x = len * cos(rad), y = len * sin(rad);
  }
  vec(point v) { x = v.x, y = v.y; }
  friend double operator*(vec a, vec b) { return a.x * b.x + a.y * b.y; }
  friend double operator^(vec a, vec b) { return a.x * b.y - a.y * b.x; }
  friend vec operator*(vec a, double b) { return vec(a.x * b, a.y * b); }
  double angle() { return atan(y / x); }
  double length() { return sqrt(x * x + y * y); }
  vec unit() {
    double L = length();
    return vec(x / L, y / L);
  }
  vec rotate(double rad) {
    return vec(x * cos(rad) - y * sin(rad), x * sin(rad) + y * cos(rad));
  }
};
struct line {
  point p, q;
  vec v;
  double ang, len;
  line() {}
  line(point p_, point q_) : p(p_), q(q_), v(q - p) {
    ang = v.angle();
    len = v.length();
  }
  line(point p_, vec v_) : p(p_), v(v_) {
    ang = v.angle();
    len = v.length();
    q = p_ + v_;
  }
  line operator+(vec move) { return line(p + move, q + move); }
  double length() { return len; }
  double angle() { return ang; }
  double dist(point c) {
    double x = (vec(c - p) ^ vec(c - q));
    return std::abs((vec(c - p) ^ vec(c - q)) / len);
  }
  point operator()(double x) { return p + (v / v.x) * x; }
  vec vertical() { return vec(-v.y, v.x); }
};
double dist(line l, point c) { return l.dist(c); }
double dist(point c, line l) { return l.dist(c); }
std::pair<point, bool> intersection(line a, line b) {
  if (a.v.unit() == b.v.unit()) return std::make_pair(point(), false);
  double s1 = vec(b.p - a.p) ^ vec(b.q - a.p),
         s2 = vec(b.q - a.q) ^ vec(b.p - a.q);
  return std::make_pair(a.p + (a.q - a.p) * s1 / (s1 + s2), true);
}
double angle(line a, line b) {
  double diff = std::abs(a.angle() - b.angle());
  return std::min(diff, pi - diff);
}
struct circle {
  point o;
  double r;
  circle(point o_, double r_) : o(o_), r(r_) {}
};
point symmetry(point a, point mid) { return mid * 2 - a; }
point D, E, F, G;
bool check(point a, point b, point c) {
  line vertab((a + b) / 2, line(a, b).vertical()),
      vertac((a + c) / 2, line(a, c).vertical());
  point meet = intersection(vertab, vertac).first;
  vec move = vec(a - meet).unit() * 2 * dist(meet, a);
  line pall_vertab = vertab + move;
  E = intersection(pall_vertab, vertac).first;
  D = symmetry(E, a);
  F = symmetry(E, c);
  G = symmetry(D, b);
  double S = vec(D - E) ^ vec(D - F);
  if (equal(S, 0)) return false;
  bool sign = S > 0;
  S = vec(E - F) ^ vec(E - G);
  if (equal(S, 0) || (S > 0) != sign) return false;
  S = vec(F - G) ^ vec(F - D);
  if (equal(S, 0) || (S > 0) != sign) return false;
  S = vec(G - D) ^ vec(G - E);
  if (equal(S, 0) || (S > 0) != sign) return false;
  printf("YES\n%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", D.x, D.y,
         E.x, E.y, F.x, F.y, G.x, G.y);
  return true;
}
void solve(point a, point b, point c) {
  if (equal(dist(line(a, b), c), 0)) return puts("NO\n"), void();
  if (check(a, b, c)) return;
  if (check(b, a, c)) return;
  if (check(c, a, b)) return;
  puts("NO\n");
}
int n;
int main() {
  std::cin >> n;
  while (n--) {
    double x, y;
    scanf("%lf%lf", &x, &y);
    point a(x, y);
    scanf("%lf%lf", &x, &y);
    point b(x, y);
    scanf("%lf%lf", &x, &y);
    point c(x, y);
    solve(a, b, c);
  }
}