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>
namespace Temps {
namespace Compare {
constexpr double eps = 1e-8;
inline void testZero(double& a) {
  if (std::abs(a) <= eps) {
    a = 0;
  }
}
inline bool equal(double a, double b) { return std::abs(b - a) <= eps; }
inline bool notEqual(double a, double b) { return std::abs(b - a) > eps; }
inline bool less(double a, double b) { return a + eps < b; }
inline bool less_equal(double a, double b) { return a <= b + eps; }
inline bool greater(double a, double b) { return a > b + eps; }
inline bool greater_equal(double a, double b) { return a + eps >= b; }
inline bool in_interval(double u, double l, double r) {
  if (l > r) {
    std::swap(l, r);
  }
  return greater_equal(u, l) && less_equal(u, r);
}
inline bool in_interval_open(double u, double l, double r) {
  if (l > r) {
    std::swap(l, r);
  }
  return greater(u, l) && less(u, r);
}
};  // namespace Compare
struct Point;
struct Circle;
struct Vector;
struct Line;
struct Segment;
struct Point {
  double x, y;
  explicit constexpr Point(double x = 0, double y = 0) : x(x), y(y) {}
  inline double distance(const Point& B) const {
    return std::sqrt((x - B.x) * (x - B.x) + (y - B.y) * (y - B.y));
  }
  inline bool operator==(const Point& B) const {
    return Compare::equal(x, B.x) && Compare::equal(y, B.y);
  }
  inline bool isnop() const { return x == INFINITY && y == INFINITY; }
  inline Point add(const Vector& b) const;
  inline Point mid(const Point& b) const {
    return Point((x + b.x) / 2, (y + b.y) / 2);
  }
  inline bool operator<(const Point& b) const {
    return x == b.x ? y < b.y : x < b.x;
  }
  inline double getAngle() const { return atan2(y, x); }
  inline friend std::ostream& operator<<(std::ostream& os, const Point& b) {
    os << "(" << b.x << "," << b.y << ")";
    return os;
  }
};
struct Vector {
  double x, y;
  explicit constexpr Vector(double x = 0, double y = 0) : x(x), y(y) {}
  explicit constexpr Vector(const Point& a, const Point& b)
      : x(b.x - a.x), y(b.y - a.y) {}
  explicit constexpr Vector(const Point& a) : x(a.x), y(a.y) {}
  explicit constexpr Vector(const Segment& a);
  inline double cross(const Vector& B) const { return x * B.y - y * B.x; }
  inline Vector mul(double p) const { return Vector(x * p, y * p); }
  inline double mul(const Vector& b) const { return x * b.x + y * b.y; }
  inline double getk() const { return y / x; }
  inline double length() const { return std::sqrt(x * x + y * y); }
  inline Vector rotater() const { return Vector(y, -x); }
  inline Vector rotatel() const { return Vector(-y, x); }
  inline Vector zoom(double newLen = 1) const {
    double factor = newLen / length();
    return Vector(x * factor, y * factor);
  }
  inline double degree(const Vector& b) const {
    return std::acos(mul(b) / (length() * b.length()));
  }
};
inline Point Point::add(const Vector& b) const {
  return Point(x + b.x, y + b.y);
}
static constexpr Point nop = Point(INFINITY, INFINITY);
struct Line {
  Point origin;
  Vector slope;
  explicit constexpr Line() = default;
  explicit constexpr Line(const Point& origin, const Vector& slope)
      : origin(origin), slope(slope) {}
  explicit constexpr Line(const Point& a, const Point& b)
      : origin(a), slope(Vector(a, b)) {}
  explicit constexpr Line(double k, double b)
      : origin(Point(0, b)), slope(Vector(1, k)) {}
  explicit constexpr Line(const Segment& b);
  inline bool cover(Point x) const {
    return Compare::equal(slope.cross(Vector(origin, x)), 0);
  }
  inline Point cross(const Line& b) const {
    double _x = Vector(origin, b.origin).cross(b.slope);
    double _y = slope.cross(b.slope);
    if (Compare::equal(_y, 0)) {
      return nop;
    }
    _x /= _y;
    return origin.add(slope.mul(_x));
  }
  inline double getk() const { return slope.getk(); }
  inline double getb() const { return origin.y + (-origin.x) * getk(); }
  inline double distance(const Point& b) const {
    return cross(Line(b, slope.rotater())).distance(b);
  }
  inline double shadowLength(const Point& b) const {
    Point shadow = cross(Line(b, slope.rotater()));
    if (Compare::equal(slope.x, 0)) {
      return (shadow.y - origin.y) / slope.y;
    }
    return (shadow.x - origin.x) / slope.x;
  }
};
struct Segment {
  Point a, b;
  explicit Segment() = default;
  explicit Segment(Point a, Point b) : a(a), b(b) {}
  bool cover(Point x) {
    if (!Compare::in_interval(x.x, a.x, b.x) ||
        !Compare::in_interval(x.y, a.y, b.y)) {
      return false;
    }
    return Line(a, b).cover(x);
  }
  inline Line getPlumb() const {
    return Line(a.mid(b), Vector(a, b).rotater());
  }
  inline Point mid() const { return a.mid(b); }
  inline double length() const { return Vector(a, b).length(); }
  inline bool isCross(const Segment& t) const {
    Point c = Line(*this).cross(Line(t));
    if (c.isnop()) {
      return false;
    }
    return Compare::in_interval(c.x, a.x, b.x) &&
           Compare::in_interval(c.y, a.y, b.y) &&
           Compare::in_interval(c.x, t.a.x, t.b.x) &&
           Compare::in_interval(c.y, t.a.y, t.b.y);
  }
  inline bool isCross_open(const Segment& t) const {
    Point c = Line(*this).cross(Line(t));
    if (c.isnop()) {
      return false;
    }
    return Compare::in_interval_open(c.x, a.x, b.x) &&
           Compare::in_interval_open(c.y, a.y, b.y) &&
           Compare::in_interval_open(c.x, t.a.x, t.b.x) &&
           Compare::in_interval_open(c.y, t.a.y, t.b.y);
  }
};
constexpr Line::Line(const Segment& b) : origin(b.a), slope(Vector(b.a, b.b)) {}
constexpr Vector::Vector(const Segment& a)
    : x(a.b.x - a.a.x), y(a.b.y - a.a.y) {}
std::vector<Point> getConvex(std::vector<Point> ps) {
  if (ps.size() <= 2) {
    return ps;
  }
  std::sort(ps.begin(), ps.end(), [](Point a, Point b) {
    return a.x == b.x ? a.y < b.y : a.x < b.x;
  });
  ps.erase(std::unique(ps.begin(), ps.end()), ps.end());
  std::vector<Point> res;
  for (Point p : ps) {
    while (res.size() >= 2) {
      Point &a = res[res.size() - 2], &b = res.back();
      if (Compare::less_equal(Vector(b, p).cross(Vector(b, a)), 0)) {
        break;
      }
      res.pop_back();
    }
    res.push_back(p);
  }
  res.pop_back();
  std::size_t osize = res.size();
  std::reverse(ps.begin(), ps.end());
  for (Point p : ps) {
    while (res.size() - osize >= 2) {
      Point &a = res[res.size() - 2], &b = res.back();
      if (Compare::less_equal(Vector(b, p).cross(Vector(b, a)), 0)) {
        break;
      }
      res.pop_back();
    }
    res.push_back(p);
  }
  res.pop_back();
  return res;
}
double getPerimeter(std::vector<Point> ps) {
  std::size_t sz = ps.size();
  double ans = 0;
  for (std::size_t i = 0; i < sz; ++i) {
    ans += ps[i].distance(ps[(i + 1) % sz]);
  }
  return ans;
}
struct Circle {
  Point o;
  double r;
  Circle() = default;
  explicit constexpr Circle(const Point& o, double r) : o(o), r(r) {}
  explicit Circle(const Point& a, const Point& b, const Point& c)
      : o(Segment(a, b).getPlumb().cross(Segment(b, c).getPlumb())),
        r(o.distance(a)) {}
  inline bool cover(const Point& p) const {
    return Compare::less_equal(o.distance(p), r);
  }
  inline double perimeter() const { return 2 * 3.14159265358979323846 * r; }
};
}  // namespace Temps
using namespace Temps;
class Scanner {
 private:
  static const int BUFFER_SIZE = 10000;
  char buff[BUFFER_SIZE];
  int buffPos, buffLim;

 public:
  Scanner() {
    buffLim = fread(buff, 1, BUFFER_SIZE, stdin);
    buffPos = 0;
  }

 private:
  inline void flushBuff() {
    buffLim = fread(buff, 1, BUFFER_SIZE, stdin);
    if (buffLim == 0) {
      buff[buffLim++] = '\n';
    }
    buffPos = 0;
  }
  inline bool isWS(char t) { return t <= ' '; }
  inline bool isDig(char t) { return t >= '0' && t <= '9'; }
  void nextPos() {
    buffPos++;
    if (buffPos == buffLim) {
      flushBuff();
    }
  }

 public:
  inline char getchar() {
    char ch = buff[buffPos];
    nextPos();
    return ch;
  }
  inline void next(char* s) {
    while (isWS(buff[buffPos])) {
      nextPos();
    }
    while (!isWS(buff[buffPos])) {
      *s = buff[buffPos];
      s++;
      nextPos();
    }
    *s = '\0';
  }
  inline void nextLine(char* s) {
    while (buff[buffPos] != '\n') {
      nextPos();
    }
    if (buff[buffPos] == '\n') {
      nextPos();
    }
    while (buff[buffPos] != '\n') {
      *s = buff[buffPos];
      s++;
      buffPos++;
    }
    *s = '\0';
  }
  inline int nextInt() {
    while (!isDig(buff[buffPos]) && buff[buffPos] != '-') {
      nextPos();
    }
    int sign = (buff[buffPos] == '-') ? nextPos(), -1 : 1;
    int res = 0;
    while (isDig(buff[buffPos])) {
      res = res * 10 + buff[buffPos] - '0';
      nextPos();
    }
    return res * sign;
  }
  inline long long nextLong() {
    while (!isDig(buff[buffPos]) && buff[buffPos] != '-') {
      nextPos();
    }
    long long sign = (buff[buffPos] == '-') ? nextPos(), -1 : 1;
    long long res = 0;
    while (isDig(buff[buffPos])) {
      res = res * 10 + buff[buffPos] - '0';
      nextPos();
    }
    return res * sign;
  }
  inline int n() {
    while (buff[buffPos] < '0' || buff[buffPos] > '9') {
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    int res = 0;
    while (buff[buffPos] >= '0' && buff[buffPos] <= '9') {
      res = res * 10 + (buff[buffPos] - '0');
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    return res;
  }
  inline long long nl() {
    while (buff[buffPos] < '0' || buff[buffPos] > '9') {
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    long long res = 0;
    while (buff[buffPos] >= '0' && buff[buffPos] <= '9') {
      res = res * 10 + (buff[buffPos] - '0');
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    return res;
  }
  inline long long nlm(const int MOD) {
    while (buff[buffPos] < '0' || buff[buffPos] > '9') {
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    long long res = 0;
    while (buff[buffPos] >= '0' && buff[buffPos] <= '9') {
      res = (res * 10 + (buff[buffPos] - '0')) % MOD;
      buffPos++;
      if (buffPos == buffLim) {
        flushBuff();
      }
    }
    return res;
  }
  inline double nextDouble() {
    while (isWS(buff[buffPos])) {
      nextPos();
    }
    int sign = (buff[buffPos] == '-') ? nextPos(), -1 : 1;
    double res = 0;
    while (isDig(buff[buffPos])) {
      res = res * 10 + buff[buffPos] - '0';
      nextPos();
    }
    if (buff[buffPos] == '.') {
      nextPos();
      double ep = 1;
      while (isDig(buff[buffPos])) {
        ep *= 0.1;
        res += ep * (buff[buffPos] - '0');
        nextPos();
      }
    }
    return sign * res;
  }
  inline char nextChar() {
    while (isWS(buff[buffPos])) nextPos();
    char res = buff[buffPos];
    nextPos();
    return res;
  }
};
Scanner sc;
template <class _Type>
void logArray(_Type a[], int n) {}
template <class T>
inline bool checkMin(T& a, T b) {
  return (a > b ? a = b, 1 : 0);
}
template <class T>
inline bool checkMax(T& a, T b) {
  return (a < b ? a = b, 1 : 0);
}
void preInit();
void init();
void solve();
int32_t main() {
  preInit();
  int T;
  T = sc.nextInt();
  while (T--) {
    init();
    solve();
  }
  return 0;
}
Point nextPoint() {
  int x = sc.n(), y = sc.n();
  return Point(x, y);
}
bool valid(Point a, Point b, Point c, Point d) {
  Vector A = Vector(a, b);
  Vector B = Vector(b, c);
  Vector C = Vector(c, d);
  Vector D = Vector(d, a);
  double crossA = A.cross(B);
  double crossB = B.cross(C);
  double crossC = C.cross(D);
  double crossD = D.cross(A);
  if (Compare::equal(crossA, 0) || Compare::equal(crossB, 0) ||
      Compare::equal(crossC, 0) || Compare::equal(crossD, 0)) {
    return false;
  }
  bool signA = crossA > 0;
  bool signB = crossB > 0;
  bool signC = crossC > 0;
  bool signD = crossD > 0;
  return signA == signB && signB == signC && signC == signD;
}
bool attempt(Point m, Point a, Point b) {
  Point b2 = m.add(Vector(b, m));
  Point B = Circle(a, m, b2).o;
  Point A = a.add(Vector(B, a));
  Point C = m.add(Vector(B, m));
  Point D = b.add(Vector(b2, B));
  if (valid(A, B, C, D)) {
    puts("YES");
    printf("%.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf %.9lf\n", A.x, A.y, B.x,
           B.y, C.x, C.y, D.x, D.y);
    return true;
  }
  return false;
}
void preInit() {}
void init() {}
void solve() {
  Point A = nextPoint(), B = nextPoint(), C = nextPoint();
  if (Compare::equal(Vector(A, B).cross(Vector(A, C)), 0)) {
    puts("NO\n");
    return;
  }
  if (attempt(A, B, C)) {
    return;
  }
  if (attempt(B, C, A)) {
    return;
  }
  if (attempt(C, A, B)) {
    return;
  }
  puts("NO\n");
}