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;
static const double EPS = 1e-2;
static const double PI = acos(-1.0);
int sgn(double x) {
  if (fabs(x) < EPS) return 0;
  if (x < 0) return -1;
  return 1;
}
struct Point {
  double x, y;
  Point() {}
  Point(double _x, double _y) : x(_x), y(_y){};
  void input() { scanf("%lf%lf", &x, &y); }
  Point operator+(const Point &o) const { return Point(x + o.x, y + o.y); }
  Point operator-(const Point &o) const { return Point(x - o.x, y - o.y); }
  double operator^(const Point &o) const { return x * o.y - y * o.x; }
  double operator*(const Point &o) const { return x * o.x + y * o.y; }
} k, l, m, a, b, c, d;
struct Line {
  Point s, e;
  Line() {}
  Line(Point _s, Point _e) : s(_s), e(_e) {}
  Line(Point p, double angle) {
    s = p;
    if (sgn(angle - PI / 2) == 0)
      e = (s + Point(0, 1));
    else
      e = (s + Point(1, tan(angle)));
  }
  double angle() {
    double k = atan2(e.y - s.y, e.x - s.x);
    if (sgn(k) < 0) k += PI;
    if (sgn(k - PI) == 0) k -= PI;
    return k;
  }
  int relation(Point p) {
    int c = sgn((p - s) ^ (e - s));
    if (c < 0)
      return 1;
    else if (c > 0)
      return 2;
    else
      return 3;
  }
  bool parallel(Line v) { return sgn((e - s) ^ (v.e - v.s)) == 0; }
  int linecrossline(Line v) {
    if ((*this).parallel(v)) return v.relation(s) == 3;
    return 2;
  }
  Point crosspoint(Line v) {
    double a1 = (v.e - v.s) ^ (s - v.s);
    double a2 = (v.e - v.s) ^ (e - v.s);
    return Point((s.x * a2 - e.x * a1) / (a2 - a1),
                 (s.y * a2 - e.y * a1) / (a2 - a1));
  }
};
int T;
bool check(Point k, Point l, Point m) {
  Point m1 = Point(2 * l.x - m.x, 2 * l.y - m.y);
  Line line1 = Line(l, m1), line2 = Line(k, l);
  Line line3 = Line(Point((l.x + m1.x) / 2, (l.y + m1.y) / 2),
                    sgn(line1.angle() - PI / 2) >= 0 ? line1.angle() - PI / 2
                                                     : line1.angle() + PI / 2);
  Line line4 = Line(Point((l.x + k.x) / 2, (l.y + k.y) / 2),
                    sgn(line2.angle() - PI / 2) >= 0 ? line2.angle() - PI / 2
                                                     : line2.angle() + PI / 2);
  if (line3.linecrossline(line4) == 2) {
    b = line3.crosspoint(line4);
    a = Point(2 * k.x - b.x, 2 * k.y - b.y);
    c = Point(2 * l.x - b.x, 2 * l.y - b.y);
    d = Point(2 * m.x - c.x, 2 * m.y - c.y);
    return sgn((a - b) ^ (a - c)) > 0 && sgn((b - c) ^ (b - d)) > 0 &&
               sgn((c - d) ^ (c - a)) > 0 && sgn((d - a) ^ (d - b)) > 0 ||
           sgn((a - b) ^ (a - c)) < 0 && sgn((b - c) ^ (b - d)) < 0 &&
               sgn((c - d) ^ (c - a)) < 0 && sgn((d - a) ^ (d - b)) < 0;
  }
  return false;
}
int main() {
  scanf("%d", &T);
  while (T--) {
    k.input();
    l.input();
    m.input();
    if (sgn((k - l) ^ (k - m)) &&
        (check(k, l, m) || check(m, k, l) || check(l, m, k)))
      printf("YES\n%.10lf %.10lf %.10lf %.10lf %.10lf %.10lf %.10lf %.10lf\n",
             a.x, a.y, b.x, b.y, c.x, c.y, d.x, d.y);
    else
      puts("NO\n");
  }
  return 0;
}