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;
bool d = false;
struct punto {
  double x;
  double y;
};
struct recta {
  double A;
  double B;
  double C;
};
struct vectorc {
  double vx;
  double vy;
};
double producto_cruz_3p(punto p1, punto p2, punto p3) {
  vectorc v1, v2;
  v1.vx = p2.x - p1.x;
  v1.vy = p2.y - p1.y;
  v2.vx = p3.x - p2.x;
  v2.vy = p3.y - p2.y;
  double aux = v1.vx * v2.vy - v1.vy * v2.vx;
  return aux;
}
punto simetria_central(punto p1, punto p2) {
  punto p3;
  p3.x = p1.x + 2 * (p2.x - p1.x);
  p3.y = p1.y + 2 * (p2.y - p1.y);
  return p3;
}
recta construct_recta(punto p1, punto p2) {
  recta ans;
  ans.A = (p2.y - p1.y);
  ans.B = (p1.x - p2.x);
  ans.C = p1.x * (p2.y - p1.y) - p1.y * (p2.x - p1.x);
  ans.C *= -1;
  return ans;
}
punto interseccion(recta r1, recta r2) {
  punto aux;
  aux.x = (-1) * (r1.C * r2.B - r2.C * r1.B) / (r1.A * r2.B - r2.A * r1.B);
  aux.y = (-1) * (r1.A * r2.C - r2.A * r1.C) / (r1.A * r2.B - r2.A * r1.B);
  return aux;
}
recta mediatriz(punto p1, punto p2) {
  recta aux = construct_recta(p1, p2);
  recta mediat;
  mediat.A = -1 * aux.B;
  mediat.B = aux.A;
  punto medio;
  medio.x = (p1.x + p2.x) / 2;
  medio.y = (p1.y + p2.y) / 2;
  mediat.C = aux.B * medio.x - aux.A * medio.y;
  return mediat;
}
punto circuncentro(punto p1, punto p2, punto p3) {
  recta r1, r2, r3;
  punto cc;
  r1 = mediatriz(p1, p2);
  r2 = mediatriz(p2, p3);
  r3 = mediatriz(p1, p3);
  cc = interseccion(r1, r2);
  return cc;
}
bool colineales(punto p1, punto p2, punto p3) {
  if (abs(producto_cruz_3p(p1, p2, p3)) < 1e-5)
    return true;
  else
    return false;
}
bool funcion(punto p1, punto p2, punto p3) {
  if (colineales(p1, p2, p3) == true) {
    return false;
  }
  punto p4 = simetria_central(p3, p2), p5;
  if (colineales(p1, p2, p4) == false) {
    p5 = circuncentro(p1, p2, p4);
  } else
    return false;
  punto p6 = simetria_central(p5, p1);
  punto p7 = simetria_central(p5, p2);
  punto p8 = simetria_central(p7, p3);
  double aux1 = producto_cruz_3p(p5, p7, p8);
  double aux2 = producto_cruz_3p(p7, p8, p6);
  double aux3 = producto_cruz_3p(p8, p6, p5);
  double aux4 = producto_cruz_3p(p6, p5, p7);
  vector<punto> a;
  a.push_back(p5);
  a.push_back(p7);
  a.push_back(p8);
  a.push_back(p6);
  if (aux1 > 0 && aux2 > 0 && aux3 > 0 && aux4 > 0 && d == false) {
    d = true;
    printf("YES\n");
    for (long i = 0; i < a.size(); i++) {
      printf("%.9lg %.9lg ", a[i].x, a[i].y);
    }
    printf("\n");
  }
  if (aux1 < 0 && aux2 < 0 && aux3 < 0 && aux4 < 0 && d == false) {
    d = true;
    printf("YES\n");
    for (long i = 0; i < a.size(); i++) {
      printf("%.15lg %.15lg ", a[i].x, a[i].y);
    }
    printf("\n");
  }
  return false;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  vector<punto> a;
  long t;
  scanf("%ld", &t);
  while (t--) {
    punto p1, p2, p3;
    scanf("%lg %lg %lg %lg %lg %lg", &p1.x, &p1.y, &p2.x, &p2.y, &p3.x, &p3.y);
    d = false;
    if (funcion(p1, p2, p3) == true) d = true;
    if (funcion(p1, p3, p2) == true) d = true;
    if (funcion(p2, p1, p3) == true) d = true;
    if (funcion(p2, p3, p1) == true) d = true;
    if (funcion(p3, p1, p2) == true) d = true;
    if (funcion(p3, p2, p1) == true) d = true;
    if (d == false) printf("NO\n\n");
  }
  return 0;
}