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 m, n, j, k, l, i, o, p, __t, X1, Y1, X2, Y2, X3, Y3;
double ax1, ay1, ax2, ax3, ax4, ay2, ay3, ay4;
char ch;
void read(int &a) {
  for (ch = getchar(); (ch < '0' || ch > '9') && (ch != '-'); ch = getchar())
    ;
  if (ch == '-')
    a = 0, __t = -1;
  else
    a = ch - '0', __t = 1;
  for (ch = getchar(); ch >= '0' && ch <= '9'; ch = getchar())
    a = a * 10 + ch - '0';
  a *= __t;
}
double f(int x11, int x12, int x21, int x22) { return x11 * x22 - x12 * x21; }
bool cut(double X1, double Y1, double X2, double Y2, double X3, double Y3,
         double X4, double Y4) {
  double xj1 = (X3 - X1) * (Y2 - Y1) - (Y3 - Y1) * (X2 - X1);
  double xj2 = (X4 - X1) * (Y2 - Y1) - (Y4 - Y1) * (X2 - X1);
  if (xj1 * xj2 <= 0) return 1;
  return 0;
}
bool solve(int X1, int Y1, int X2, int Y2, int X3, int Y3) {
  int X4 = 2 * X2 - X3;
  int Y4 = 2 * Y2 - Y3;
  int A1 = 2 * (X1 - X4), B1 = 2 * (Y1 - Y4),
      C1 = X1 * X1 + Y1 * Y1 - X4 * X4 - Y4 * Y4;
  int A2 = 2 * (X2 - X4), B2 = 2 * (Y2 - Y4),
      C2 = X2 * X2 + Y2 * Y2 - X4 * X4 - Y4 * Y4;
  double _x2 = f(C1, B1, C2, B2) / f(A1, B1, A2, B2);
  double _y2 = f(A1, C1, A2, C2) / f(A1, B1, A2, B2);
  double _x1 = 2 * X1 - _x2;
  double _y1 = 2 * Y1 - _y2;
  double _x3 = 2 * X2 - _x2;
  double _y3 = 2 * Y2 - _y2;
  double _x4 = 2 * X3 - _x3;
  double _y4 = 2 * Y3 - _y3;
  if ((_x1 - _x4) * (_y3 - _y4) == (_y1 - _y4) * (_x3 - _x4)) return 0;
  if (cut(_x1, _y1, _x2, _y2, _x3, _y3, _x4, _y4)) return 0;
  if (cut(_x2, _y2, _x3, _y3, _x4, _y4, _x1, _y1)) return 0;
  double xj1 = (_x1 - _x2) * (_y2 - _y3) - (_x2 - _x3) * (_y1 - _y2);
  double xj2 = (_x2 - _x3) * (_y3 - _y4) - (_x3 - _x4) * (_y2 - _y3);
  double xj3 = (_x3 - _x4) * (_y4 - _y1) - (_x4 - _x1) * (_y3 - _y4);
  double xj4 = (_x4 - _x1) * (_y1 - _y2) - (_x1 - _x2) * (_y4 - _y1);
  if (fabs(xj1) < 1e-8 || fabs(xj2) < 1e-8 || fabs(xj3) < 1e-8 ||
      fabs(xj4) < 1e-8)
    return 0;
  bool pos = 0;
  if (xj1 < 0) pos = 1;
  if ((pos != (xj2 < 0)) || (pos != (xj3 < 0)) || (pos != (xj4 < 0))) return 0;
  ax1 = _x1;
  ax2 = _x2;
  ax3 = _x3;
  ax4 = _x4;
  ay1 = _y1;
  ay2 = _y2;
  ay3 = _y3;
  ay4 = _y4;
  return 1;
}
int main() {
  read(m);
  for (int i = 1; i <= m; i++) {
    read(X1), read(Y1), read(X2), read(Y2), read(X3), read(Y3);
    if ((X2 - X1) * (Y3 - Y1) == (Y2 - Y1) * (X3 - X1)) {
      printf("NO\n\n");
      continue;
    }
    if (solve(X1, Y1, X2, Y2, X3, Y3) || solve(X1, Y1, X3, Y3, X2, Y2) ||
        solve(X2, Y2, X1, Y1, X3, Y3))
      printf("YES\n%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", ax1, ay1,
             ax2, ay2, ax3, ay3, ax4, ay4);
    else
      printf("NO\n\n");
  }
}