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;
vector<pair<double, double> > vec;
double x[10], y[10];
int cross(pair<double, double> a, pair<double, double> b,
          pair<double, double> c) {
  double re = (a.first - c.first) * (b.second - c.second);
  re -= (a.second - c.second) * (b.first - c.first);
  if (fabs(re) < 1e-8) return 0;
  return re > 0 ? 1 : -1;
}
bool work() {
  double x0, y0, d, xb, yb, xc, yc, xa, ya, xd, yd;
  int i;
  x0 = x[1] * 2 - x[2];
  y0 = y[1] * 2 - y[2];
  d = x0 * (y[1] - y[3]) + x[1] * (y[3] - y0) + x[3] * (y0 - y[1]);
  d *= 2;
  xb = (x0 * x0 + y0 * y0) * (y[1] - y[3]);
  xb += (x[1] * x[1] + y[1] * y[1]) * (y[3] - y0);
  xb += (x[3] * x[3] + y[3] * y[3]) * (y0 - y[1]);
  xb /= d;
  yb = (x0 * x0 + y0 * y0) * (x[3] - x[1]);
  yb += (x[1] * x[1] + y[1] * y[1]) * (x0 - x[3]);
  yb += (x[3] * x[3] + y[3] * y[3]) * (x[1] - x0);
  yb /= d;
  xc = 2 * x[1] - xb;
  yc = 2 * y[1] - yb;
  xa = 2 * x[3] - xb;
  ya = 2 * y[3] - yb;
  xd = 2 * x[2] - xc;
  yd = 2 * y[2] - yc;
  vec.clear();
  vec.push_back(make_pair(xa, ya));
  vec.push_back(make_pair(xd, yd));
  vec.push_back(make_pair(xc, yc));
  vec.push_back(make_pair(xb, yb));
  for (i = 0; i < 4; i++)
    if (cross(vec[i], vec[(i + 1) % 4], vec[(i + 2) % 4]) *
            cross(vec[i], vec[(i + 1) % 4], vec[(i + 3) % 4]) <=
        0)
      return false;
  printf("YES\n");
  for (i = 0; i < 4; i++) printf("%.10f %.10f ", vec[i].first, vec[i].second);
  printf("\n");
  return true;
}
int main() {
  int T, i;
  scanf("%d", &T);
  while (T--) {
    for (i = 1; i <= 3; i++) scanf("%lf%lf", &x[i], &y[i]);
    if ((x[1] - x[3]) * (y[2] - y[3]) == (y[1] - y[3]) * (x[2] - x[3])) {
      printf("NO\n\n");
      continue;
    }
    if (work()) continue;
    swap(x[1], x[2]);
    swap(y[1], y[2]);
    if (work()) continue;
    swap(x[1], x[3]);
    swap(y[1], y[3]);
    if (work()) continue;
    printf("NO\n\n");
  }
}