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 int MAXN = 5 + 1;
const double EPS = 1e-10;
pair<double, double> operator+(const pair<double, double> &a,
                               const pair<double, double> &b) {
  return make_pair(a.first + b.first, a.second + b.second);
}
pair<double, double> operator-(const pair<double, double> &a,
                               const pair<double, double> &b) {
  return make_pair(a.first - b.first, a.second - b.second);
}
pair<double, double> operator*(const pair<double, double> &a, double k) {
  return make_pair(a.first * k, a.second * k);
}
pair<double, double> operator/(const pair<double, double> &a, double k) {
  return make_pair(a.first / k, a.second / k);
}
bool operator==(const pair<double, double> &a, const pair<double, double> &b) {
  return fabs(a.first - b.first) < EPS && fabs(a.second - b.second) < EPS;
}
double det(const pair<double, double> &a, const pair<double, double> &b) {
  return a.first * b.second - b.first * a.second;
}
pair<double, double> intersect(const pair<double, double> &a,
                               const pair<double, double> &b,
                               const pair<double, double> &c,
                               const pair<double, double> &d) {
  double k1 = det(c - a, b - a), k2 = det(d - a, b - a);
  if (fabs(k1 - k2) < EPS) return make_pair(0, 0);
  return (d * k1 - c * k2) / (k1 - k2);
}
double dist(const pair<double, double> &a) {
  return a.first * a.first + a.second * a.second;
}
pair<double, double> Read() {
  pair<double, double> a;
  scanf("%lf%lf", &a.first, &a.second);
  return a;
}
void Print(const pair<double, double> &a) {
  printf("%.9lf %.9lf ", a.first, a.second);
}
pair<double, double> a, b, c, p[MAXN];
bool solve(const pair<double, double> &a, const pair<double, double> &b,
           const pair<double, double> &c) {
  pair<double, double> H1 = (a + b) / 2, H2 = c + (b - c) * 1.5;
  pair<double, double> v1 = b - a, v2 = b - c;
  v1 = make_pair(-v1.second, v1.first), v2 = make_pair(-v2.second, v2.first);
  pair<double, double> A = intersect(H1, H1 + v1, H2, H2 + v2);
  if (A == make_pair(0, 0)) {
    return false;
  }
  pair<double, double> B = A + (b - A) * 2, D = A + (a - A) * 2,
                       C = B + (c - B) * 2;
  p[0] = A, p[1] = B, p[2] = C, p[3] = D;
  int tmp = 0, cnt1 = 0, cnt2 = 0;
  double dis1 = 0, dis2 = 0;
  for (int i = 0; i < 4; ++i) {
    double d = det(p[(i - 1 + 4) % 4] - p[i], p[(i + 1) % 4] - p[i]);
    if (fabs(d) < EPS) {
      return false;
    }
    if (tmp == 0)
      tmp = d > 0 ? 1 : -1;
    else if (d > 0 != tmp > 0) {
      return false;
    }
    double dis = dist(p[i] - p[(i + 1) % 4]);
    if (dis1 == 0 || (fabs(dis - dis1) < EPS))
      dis1 = dis, ++cnt1;
    else if (dis2 == 0 || (fabs(dis - dis2) < EPS))
      dis2 = dis, ++cnt2;
    else
      return false;
  }
  if (cnt1 < 3 && cnt2 < 3) return false;
  puts("YES");
  for (int i = 0; i < 4; ++i) Print(p[i]);
  puts("");
  return true;
}
int main() {
  int test;
  scanf("%d", &test);
  pair<double, double> a, b, c;
  while (test) {
    a = Read();
    b = Read();
    c = Read();
    if (!solve(a, b, c))
      if (!solve(a, c, b))
        if (!solve(b, a, c))
          if (!solve(b, c, a))
            if (!solve(c, a, b))
              if (!solve(c, b, a)) printf("NO\n\n");
    --test;
  }
  fclose(stdin);
  fclose(stdout);
  return 0;
}