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>
inline int cmp(double x, double y = 0, double tol = 1e-9) {
  return (x <= y + tol) ? (x + tol < y) ? -1 : 0 : 1;
}
struct recta {
  double A, B, C;
};
recta from2points(std::pair<double, double>& p, std::pair<double, double>& q) {
  recta r;
  r.A = p.second - q.second;
  r.B = q.first - p.first;
  r.C = r.A * p.first + r.B * p.second;
  return r;
}
recta perpendicular(recta& r, std::pair<double, double>& p) {
  recta rp;
  rp.A = -r.B;
  rp.B = r.A;
  rp.C = rp.A * p.first + rp.B * p.second;
  return rp;
}
std::pair<double, double> intersection(recta r1, recta r2) {
  double det = r1.A * r2.B - r1.B * r2.A;
  double first = (r1.C * r2.B - r2.C * r1.B) / det;
  double second = (r1.A * r2.C - r2.A * r1.C) / det;
  return std::pair<double, double>(first, second);
}
int cross_product(std::pair<double, double>& p0, std::pair<double, double>& p1,
                  std::pair<double, double>& q) {
  std::pair<double, double> a(p1.first - p0.first, p1.second - p0.second);
  std::pair<double, double> b(q.first - p0.first, q.second - p0.second);
  return a.first * b.second - a.second * b.first;
}
std::pair<double, double> midpoint(std::pair<double, double>& p,
                                   std::pair<double, double>& q) {
  double first = (p.first + q.first) / 2;
  double second = (p.second + q.second) / 2;
  return std::pair<double, double>(first, second);
}
std::pair<double, double> mirror(std::pair<double, double>& from,
                                 std::pair<double, double>& center) {
  double dx = from.first - center.first;
  double dy = from.second - center.second;
  return std::pair<double, double>(center.first - dx, center.second - dy);
}
std::pair<double, double> circumcenter(std::pair<double, double>& a,
                                       std::pair<double, double>& b,
                                       std::pair<double, double>& c) {
  recta r1 = from2points(a, b);
  recta r2 = from2points(b, c);
  std::pair<double, double> m1 = midpoint(a, b);
  std::pair<double, double> m2 = midpoint(b, c);
  return intersection(perpendicular(r1, m1), perpendicular(r2, m2));
}
bool is_convex(std::pair<double, double>& a, std::pair<double, double>& b,
               std::pair<double, double>& c, std::pair<double, double>& d) {
  bool ac = cross_product(a, c, b) * cross_product(a, c, d) < 0;
  bool bd = cross_product(b, d, a) * cross_product(b, d, c) < 0;
  return ac && bd;
}
int main() {
  int T;
  scanf("%d", &T);
  while (T--) {
    std::pair<double, double> p[3];
    for (int i = (0); i <= (int)(2); ++i)
      scanf("%lf %lf", &p[i].first, &p[i].second);
    for (int i = (0); i <= (int)(2); ++i) {
      std::pair<double, double>& k = p[i];
      std::pair<double, double>& l = p[(i + 1) % 3];
      std::pair<double, double>& m = p[(i + 2) % 3];
      std::pair<double, double> m1 = mirror(m, l);
      std::pair<double, double> b = circumcenter(k, l, m1);
      std::pair<double, double> a = mirror(b, k);
      std::pair<double, double> c = mirror(b, l);
      std::pair<double, double> d = mirror(c, m);
      if (is_convex(a, b, c, d)) {
        puts("YES");
        printf("%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", a.first,
               a.second, b.first, b.second, c.first, c.second, d.first,
               d.second);
        goto next_input;
      }
    }
    puts("NO\n");
  next_input:;
  }
  return 0;
}