Group of Berland scientists, with whom you have a close business relationship, makes a research in the area of peaceful nuclear energy. In particular, they found that a group of four nanobots, placed on a surface of a plate, can run a powerful chain reaction under certain conditions. 

To be precise, researchers introduced a rectangular Cartesian coordinate system on a flat plate and selected four distinct points with integer coordinates where bots will be placed initially. Next each bot will be assigned with one of the four directions (up, down, left or right) parallel to the coordinate axes. After that, each bot is shifted by an integer distance (which may be different for different bots) along its direction. The chain reaction starts, if the bots are in the corners of a square with positive area with sides parallel to the coordinate axes. Each corner of the square must contain one nanobot. This reaction will be stronger, if bots spend less time to move. We can assume that bots move with unit speed. In other words, the lesser is the maximum length traveled by bot, the stronger is reaction.

Scientists have prepared a set of plates and selected starting position for the bots for each plate. Now they ask you to assign the direction for each bot to move after landing such that the maximum length traveled by bot is as small as possible.

Input

The first line contains an integer number t (1 ≤ t ≤ 50) — the number of plates.

t descriptions of plates follow. A description of each plate consists of four lines. Each line consists of a pair of integers numbers xi, yi ( - 108 ≤ xi, yi ≤ 108) — coordinates of the next bot. All bots are in different locations.

Note, though, the problem can include several records in one test, you can hack other people's submissions only with the test of one plate, i.e. parameter t in a hack test should be equal to 1.

Output

Print answers for all plates separately. First goes a single integer number in a separate line. If scientists have made an unfortunate mistake and nanobots are not able to form the desired square, print -1. Otherwise, print the minimum possible length of the longest bot's path.

If a solution exists, in the next four lines print two integer numbers — positions of each bot after moving. Print bots' positions in the order they are specified in the input data.

If there are multiple solution, you can print any of them.

Examples

Input

2
1 1
1 -1
-1 1
-1 -1
1 1
2 2
4 4
6 6


Output

0
1 1
1 -1
-1 1
-1 -1
-1
#include <bits/stdc++.h>
using namespace std;
inline int abv(int x) { return x < 0 ? -x : x; }
int A[4], B[4], a[4], b[4], c[4], i, j, s, t, u, v, y, z;
inline void check(int E, int F, int G, int H) {
  int x = max(max(abv(a[c[0]] - E + abv(b[c[0]] - G)),
                  abv(a[c[1]] - E + abv(b[c[1]] - H))),
              max(abv(a[c[2]] - F + abv(b[c[2]] - G)),
                  abv(a[c[3]] - F + abv(b[c[3]] - H))));
  if (x < s)
    A[c[0]] = A[c[1]] = E, A[c[2]] = A[c[3]] = F, B[c[0]] = B[c[2]] = G,
    B[c[1]] = B[c[3]] = H, s = x;
}
inline void solve() {
  if (a[c[0]] == a[c[1]] && a[c[2]] == a[c[3]] && a[c[0]] <= a[c[2]])
    z = a[c[2]] - a[c[0]],
    y = max(max(b[c[0]], b[c[1]] - z), max(b[c[2]], b[c[3]] - z)) +
            min(min(b[c[0]], b[c[1]] - z), min(b[c[2]], b[c[3]] - z)) >>
        1,
    check(a[c[0]], a[c[2]], y, y + z);
  if (b[c[0]] == b[c[2]] && b[c[1]] == b[c[3]] && b[c[0]] <= b[c[1]])
    z = b[c[1]] - b[c[0]],
    y = max(max(a[c[0]], a[c[2]] - z), max(a[c[1]], a[c[3]] - z)) +
            min(min(a[c[0]], a[c[2]] - z), min(a[c[1]], a[c[3]] - z)) >>
        1,
    check(y, y + z, b[c[0]], b[c[1]]);
  for (i = 0; i < 2; i++)
    for (j = 0; j < 2; j++)
      if (a[c[u = i]] < a[c[v = 2 | j]]) {
        z = a[c[v]] - a[c[u]];
        if (a[c[u ^ 1]] != a[c[u]] &&
            (a[c[v ^ 1]] == a[c[v]] ||
             b[c[u ^ 1]] + z * ((j ^ 1) - (i ^ 1)) == b[c[v ^ 1]]))
          check(a[c[u]], a[c[v]], b[c[u ^ 1]] - (i & 1 ? 0 : z),
                b[c[u ^ 1]] + (i & 1 ? z : 0));
        if (a[c[v ^ 1]] != a[c[v]] &&
            (a[c[u ^ 1]] == a[c[u]] ||
             b[c[v ^ 1]] + z * ((i ^ 1) - (j ^ 1)) == b[c[u ^ 1]]))
          check(a[c[u]], a[c[v]], b[c[v ^ 1]] - (j & 1 ? 0 : z),
                b[c[v ^ 1]] + (j & 1 ? z : 0));
      }
  for (i = 0; i < 2; i++)
    for (j = 0; j < 2; j++)
      if (b[c[u = i << 1]] < b[c[v = j << 1 | 1]]) {
        z = b[c[v]] - b[c[u]];
        if (b[c[u ^ 2]] != b[c[u]] &&
            (b[c[v ^ 2]] == b[c[v]] ||
             a[c[u ^ 2]] + z * ((j ^ 1) - (i ^ 1)) == a[c[v ^ 2]]))
          check(a[c[u ^ 2]] - (i & 1 ? 0 : z), a[c[u ^ 2]] + (i & 1 ? z : 0),
                b[c[u]], b[c[v]]);
        if (b[c[v ^ 2]] != b[c[v]] &&
            (b[c[u ^ 2]] == b[c[u]] ||
             a[c[v ^ 2]] + z * ((i ^ 1) - (j ^ 1)) == a[c[u ^ 2]]))
          check(a[c[v ^ 2]] - (j & 1 ? 0 : z), a[c[v ^ 2]] + (j & 1 ? z : 0),
                b[c[u]], b[c[v]]);
      }
}
int main() {
  for (scanf("%d", &t); t--;
       s == 800000008 ? puts("-1")
                      : printf("%d\n%d %d\n%d %d\n%d %d\n%d %d\n", s, A[0],
                               B[0], A[1], B[1], A[2], B[2], A[3], B[3]))
    for (scanf("%d%d%d%d%d%d%d%d", a, b, a + 1, b + 1, a + 2, b + 2, a + 3,
               b + 3),
         s = 800000008, c[0] = 0, c[1] = 1, c[2] = 2, c[3] = 3, solve();
         next_permutation(c, c + 4); solve())
      ;
  return 0;
}
