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;
int flag = 0;
struct point {
  double x, y;
  point() {}
  point(double x, double y) : x(x), y(y){};
};
struct line {
  double a, b, c;
  line(double a, double b, double c) : a(a), b(b), c(c) {}
};
point operator+(point p1, point p2) { return point(p1.x + p2.x, p1.y + p2.y); }
point operator-(point p1, point p2) { return point(p1.x - p2.x, p1.y - p2.y); }
bool cmp(const point& p1, const point& p2) {
  return (p1.x < p2.x || (p1.x == p2.x && p1.y < p2.y));
}
int dcmp(double x) { return (fabs(x) <= 1e-6) ? 0 : (x < 0 ? -1 : 1); }
line pointtoline(point p, point q) {
  return line(p.y - q.y, q.x - p.x, p.x * q.y - p.y * q.x);
}
point mid(point p1, point p2) {
  return point((p1.x + p2.x) / (2.0), (p1.y + p2.y) / (2.0));
}
point sym(point p1, point p2) {
  return point(2.0 * p2.x - p1.x, 2.0 * p2.y - p1.y);
}
line per(line l, point p) { return line(-l.b, l.a, l.b * p.x - l.a * p.y); }
line par(line l, point p) { return line(l.a, l.b, -(l.a * p.x + l.b * p.y)); }
double triangelsquare(point a, point b, point c) {
  return fabs(a.x * b.y - a.y * b.x + c.x * a.y - c.y * a.x + b.x * c.y -
              b.y * c.x) /
         (2.0);
}
point inter(line l1, line l2) {
  return point((-l1.c * l2.b + l2.c * l1.b) / (l1.a * l2.b - l2.a * l1.b),
               (-l1.a * l2.c + l2.a * l1.c) / (l1.a * l2.b - l2.a * l1.b));
}
double dist(point p1, point p2) {
  return sqrt((p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y));
}
bool checktriangle(point a, point b, point c) {
  return (!dcmp(fabs(dist(a, b) + dist(a, c) - dist(b, c)))) ||
         (!dcmp(fabs(dist(b, c) + dist(a, b) - dist(c, a)))) ||
         (!dcmp(fabs(dist(c, a) + dist(b, c) - dist(a, b))));
}
double square(point a, point b, point c, point d) {
  return fabs(a.x * b.y - b.x * a.y + b.x * c.y - b.y * c.x + c.x * d.y -
              c.y * d.x + d.x * a.y - d.y * a.x) /
         (2.0);
}
void Work(point a, point b, point c) {
  if (flag) return;
  line l1 = per(pointtoline(a, b), mid(a, b)),
       l2 = per(pointtoline(b, c), mid(b, c));
  point D = inter(l1, l2);
  point E = sym(D, b);
  point F = inter(l1, par(l2, E));
  point G = sym(F, b);
  point H = sym(G, c), I = sym(F, a);
  if (!dcmp(square(F, G, H, I) - triangelsquare(F, G, H) -
            triangelsquare(F, H, I)) &&
      !dcmp(square(F, G, H, I) - triangelsquare(F, G, I) -
            triangelsquare(G, H, I)))
    if (!checktriangle(F, G, H) && !checktriangle(F, G, I) &&
        !checktriangle(F, H, I) && !checktriangle(G, H, I)) {
      flag = 1;
      printf("YES\n");
      printf("%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", I.x, I.y, F.x,
             F.y, G.x, G.y, H.x, H.y);
    }
}
void getAnswer() {
  point a, b, c;
  flag = 0;
  scanf("%lf %lf %lf %lf %lf %lf", &a.x, &a.y, &b.x, &b.y, &c.x, &c.y);
  if (checktriangle(a, b, c))
    printf("NO\n");
  else {
    Work(a, b, c);
    Work(a, c, b);
    Work(b, c, a);
    Work(b, a, c);
    Work(c, a, b);
    Work(c, b, a);
    if (!flag) printf("NO\n");
  }
}
int main() {
  int t = 0;
  scanf("%d", &t);
  while (t--) getAnswer();
  return 0;
}