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;
inline bool SR(int &x) { return scanf("%d", &x) == 1; }
inline bool SR(long long &x) { return scanf("%lld", &x) == 1; }
inline bool SR(double &x) { return scanf("%lf", &x); }
inline bool SR(char *s) { return scanf("%s", s); }
inline bool RI() { return 1; }
template <typename I, typename... T>
bool RI(I &x, T &...tail) {
  return SR(x) && RI(tail...);
}
inline void SP(const int x) { printf("%d", x); }
inline void SP(const long long x) { printf("%lld", x); }
inline void SP(const double x) { printf("%.10f", x); }
inline void SP(const char *s) { printf("%s", s); }
inline void PL() { puts(""); }
template <typename I, typename... T>
void PL(const I x, const T... tail) {
  SP(x);
  if (sizeof...(tail)) putchar(' ');
  PL(tail...);
}
template <typename I>
inline void _DOING(const char *s, I &&x) {
  cerr << s << " = " << x << '\n';
}
template <typename I, typename... T>
void _DOING(const char *s, I &&x, T &&...tail) {
  int c = 0;
  while (*s != ',' || c != 0) {
    if (*s == '(' || *s == '[' || *s == '{') c++;
    if (*s == ')' || *s == ']' || *s == '}') c--;
    cerr << *s++;
  }
  cerr << " = " << x << " , ";
  _DOING(s + 1, tail...);
}
const int INF = 0x3f3f3f3f;
const long long INF64 = 0x3f3f3f3f3f3f3f3fll;
inline int RAND() {
  static int x = 880301;
  return x = (x * 0xdefacedll + 1ll) % 0x7fffffffll;
}
const double EPS = 1e-6;
struct Point {
  double x, y;
  Point(double _x = 0.0, double _y = 0.0) : x(_x), y(_y) {}
  bool operator<(const Point &rhs) const {
    if (x != rhs.x)
      return x < rhs.x;
    else
      return y < rhs.y;
  }
};
inline Point operator+(Point p, Point v) { return Point(p.x + v.x, p.y + v.y); }
inline Point operator-(Point a, Point b) { return Point(a.x - b.x, a.y - b.y); }
inline Point operator*(Point v, double p) { return Point(v.x * p, v.y * p); }
inline Point operator/(Point v, double p) { return Point(v.x / p, v.y / p); }
inline Point normal(Point v) { return Point(-v.y, v.x); }
inline int dcmp(double x) { return fabs(x) < EPS ? 0 : x > 0 ? 1 : -1; }
inline double cross(Point a, Point b) { return a.x * b.y - a.y * b.x; }
inline double dot(Point a, Point b) { return a.x * b.x + a.y * b.y; }
inline double len(Point v) { return sqrt(dot(v, v)); }
inline double dist(Point a, Point b) { return len(a - b); }
inline vector<Point> calc(Point a, Point b, Point c) {
  Point d = (a + b) / 2.0;
  Point e = (b + c) / 2.0;
  Point u = normal(a - b);
  Point v = normal(c - b);
  vector<Point> res;
  if (dcmp(cross(u, v)) == 0) return res;
  double t = ((2 * b.x - d.x - e.x) * v.y - (2 * b.y - d.y - e.y) * v.x) /
             (u.x * v.y - u.y * v.x);
  Point p = d + u * t;
  Point q = b * 2 - p;
  Point r = c * 2 - q;
  Point s = a * 2 - p;
  if (dcmp(len(p - s) - len(p - q)) != 0) return res;
  if (dcmp(len(p - q) - len(q - r)) != 0) return res;
  if (dcmp(cross(q - r, p - r)) * dcmp(cross(q - r, s - r)) < 0) return res;
  if (dcmp(cross(r - q, p - q)) * dcmp(cross(r - q, s - q)) < 0) return res;
  if (dcmp(cross(q - p, r - p)) * dcmp(cross(q - p, s - p)) < 0) return res;
  if (dcmp(cross(p - q, r - q)) * dcmp(cross(p - q, s - q)) < 0) return res;
  res.push_back(p);
  res.push_back(q);
  res.push_back(r);
  res.push_back(s);
  return res;
}
inline bool check(vector<Point> ps) {
  if (((int)ps.size()) != 4) return 0;
  for (int i = 0; i < int(4); i++) {
    vector<Point> tmp;
    Point p = ps[i];
    for (int j = 0; j < int(4); j++) {
      if (j != i) tmp.push_back(ps[j]);
    }
    double a1 = fabs(cross(tmp[0] - p, tmp[1] - p));
    double a2 = fabs(cross(tmp[1] - p, tmp[2] - p));
    double a3 = fabs(cross(tmp[2] - p, tmp[0] - p));
    double a4 = fabs(cross(tmp[2] - tmp[0], tmp[1] - tmp[0]));
    if (dcmp(a4 - a1 - a2 - a3) == 0) return 0;
  }
  return 1;
}
inline vector<Point> solve(Point a, Point b, Point c) {
  vector<Point> res;
  res = calc(a, b, c);
  if (check(res)) return res;
  res.clear();
  res = calc(a, c, b);
  if (check(res)) return res;
  res.clear();
  res = calc(b, a, c);
  if (check(res)) return res;
  res.clear();
  return res;
}
int main() {
  int T;
  RI(T);
  while (T--) {
    Point a, b, c;
    RI(a.x, a.y, b.x, b.y, c.x, c.y);
    vector<Point> ans;
    ans = solve(a, b, c);
    if (!((int)ans.size()))
      PL("NO");
    else {
      PL("YES");
      for (Point p : ans) printf("%.10f %.10f ", p.x, p.y);
    }
    PL();
  }
  return 0;
}