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>
int ccw(double x1, double y1, double x2, double y2, double x3, double y3) {
  double dx1 = x2 - x1;
  double dy1 = y2 - y1;
  double dx2 = x3 - x2;
  double dy2 = y3 - y2;
  double diff = dy1 * dx2 - dy2 * dx1;
  if (fabs(diff) < 1e-7) return 0;
  if (diff < 0)
    return 1;
  else
    return -1;
}
int find(int x1, int y1, int x2, int y2, int x3, int y3) {
  if ((x2 - x1) * (y3 - y2) == (y2 - y1) * (x3 - x2)) return 0;
  int ax = x1, ay = y1;
  int bx = -x2 + 2 * x1, by = -y2 + 2 * y1;
  int cx = x3 - 2 * x2 + 2 * x1, cy = y3 - 2 * y2 + 2 * y1;
  int d = 2 * (ax * (by - cy) + bx * (cy - ay) + cx * (ay - by));
  double p0x =
      ((ay * ay + ax * ax) * (by - cy) + (by * by + bx * bx) * (cy - ay) +
       (cy * cy + cx * cx) * (ay - by)) /
      (double)d;
  double p0y =
      ((ay * ay + ax * ax) * (cx - bx) + (by * by + bx * bx) * (ax - cx) +
       (cy * cy + cx * cx) * (bx - ax)) /
      (double)d;
  double p1x = 2 * x1 - p0x;
  double p1y = 2 * y1 - p0y;
  double p2x = 2 * x2 - p1x;
  double p2y = 2 * y2 - p1y;
  double p3x = 2 * x3 - p2x;
  double p3y = 2 * y3 - p2y;
  double ccw1 = ccw(p0x, p0y, p1x, p1y, p2x, p2y);
  double ccw2 = ccw(p1x, p1y, p2x, p2y, p3x, p3y);
  double ccw3 = ccw(p2x, p2y, p3x, p3y, p0x, p0y);
  double ccw4 = ccw(p3x, p3y, p0x, p0y, p1x, p1y);
  if (ccw1 == 0 || ccw2 == 0 || ccw3 == 0 || ccw4 == 0) return 0;
  if (ccw1 != ccw2 || ccw2 != ccw3 || ccw3 != ccw4) return 0;
  printf("YES\n");
  printf("%.9f %.9f %.9f %.9f %.9f %.9f %.9f %.9f\n", p0x, p0y, p1x, p1y, p2x,
         p2y, p3x, p3y);
  return 1;
}
int main() {
  int T;
  scanf("%d", &T);
  for (int i = 0; i < T; i++) {
    int x1, y1, x2, y2, x3, y3;
    scanf("%d %d %d %d %d %d", &x1, &y1, &x2, &y2, &x3, &y3);
    if (!find(x1, y1, x2, y2, x3, y3))
      if (!find(x1, y1, x3, y3, x2, y2))
        if (!find(x2, y2, x1, y1, x3, y3)) printf("NO\n\n");
  }
  return 0;
}