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;
const double PI = acos(-1);
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T alex(T x) {
  return (x > 0) ? x : -x;
}
template <class T>
void read(T& x) {
  x = 0;
  T f = 1;
  char ch = getchar();
  while ((ch < 48 || ch > 57) && ch != 45) ch = getchar();
  if (ch == 45) f = -1, ch = getchar();
  while (ch >= 48 && ch <= 57) x = x * 10 + ch - 48, ch = getchar();
  x *= f;
}
int T;
struct Point {
  double x, y;
  Point() {}
  Point(double x, double y) : x(x), y(y) {}
  Point operator+(const Point& p) const { return Point(x + p.x, y + p.y); }
  Point operator-(const Point& p) const { return Point(x - p.x, y - p.y); }
  Point operator*(const double& d) const { return Point(d * x, d * y); }
  double operator^(const Point& p) const { return x * p.y - y * p.x; }
  void readin() { scanf("%lf%lf", &x, &y); }
  void print() { printf("%lf %lf\n", x, y); }
} P[3];
struct Line {
  Point s, v;
  Line() {}
  Line(Point s, Point v) : s(s), v(v) {}
  void print() { printf("(%lf %lf)(%lf %lf)\n", s.x, s.y, v.x, v.y); }
};
Point inter(Line l1, Line l2) {
  double lambda = ((l2.s - l1.s) ^ l2.v) / (l1.v ^ l2.v);
  return l1.s + l1.v * lambda;
}
double sqr(double x) { return x * x; }
Point rotate(Point p, double theta) {
  return Point(cos(theta) * p.x - sin(theta) * p.y,
               sin(theta) * p.x + cos(theta) * p.y);
}
Line PB(Point x, Point y) {
  return Line((x + y) * 0.5, rotate(y - x, PI / 2.0));
}
vector<Point> Solve(Point x, Point y, Point z) {
  Line PB1 = PB(x, y), PB2 = PB(y, z);
  vector<Point> res;
  res.clear();
  if (fabs(PB1.v ^ PB2.v) < 1e-9) return res;
  Point p = inter(PB1, PB2), q = y * 2.0 - p;
  Point b = inter(PB1, Line(q, PB2.v));
  Point a = x * 2.0 - b, c = y * 2.0 - b, d = z * 2.0 - c;
  res.push_back(a);
  res.push_back(b);
  res.push_back(c);
  res.push_back(d);
  return res;
}
int sign(double x) {
  if (fabs(x) < 1e-9)
    return 0;
  else if (x > 1e-9)
    return 1;
  else
    return -1;
}
bool check(vector<Point> res) {
  if (sign((res[1] - res[0]) ^ (res[2] - res[0])) *
          sign((res[1] - res[0]) ^ (res[3] - res[0])) <=
      0)
    return false;
  if (sign((res[2] - res[1]) ^ (res[3] - res[1])) *
          sign((res[2] - res[1]) ^ (res[0] - res[1])) <=
      0)
    return false;
  if (sign((res[3] - res[2]) ^ (res[0] - res[2])) *
          sign((res[3] - res[2]) ^ (res[1] - res[2])) <=
      0)
    return false;
  if (sign((res[0] - res[3]) ^ (res[1] - res[3])) *
          sign((res[0] - res[3]) ^ (res[2] - res[3])) <=
      0)
    return false;
  return true;
}
void work() {
  P[0].readin();
  P[1].readin();
  P[2].readin();
  vector<Point> vec;
  vec.clear();
  vec = Solve(P[0], P[1], P[2]);
  if (vec.size() > 0 && check(vec)) {
    printf("YES\n");
    for (int i = (0); i < (4); i++) printf("%.9f %.9f ", vec[i].x, vec[i].y);
    puts("");
    return;
  }
  vec = Solve(P[1], P[2], P[0]);
  if (vec.size() > 0 && check(vec)) {
    printf("YES\n");
    for (int i = (0); i < (4); i++) printf("%.9f %.9f ", vec[i].x, vec[i].y);
    puts("");
    return;
  }
  vec = Solve(P[2], P[0], P[1]);
  if (vec.size() > 0 && check(vec)) {
    printf("YES\n");
    for (int i = (0); i < (4); i++) printf("%.9f %.9f ", vec[i].x, vec[i].y);
    puts("");
    return;
  }
  printf("NO\n\n");
}
int main() {
  read(T);
  while (T--) work();
  return 0;
}