Problem: There are four stones on an infinite line in integer coordinates a_1, a_2, a_3, a_4. The goal is to have the stones in coordinates b_1, b_2, b_3, b_4. The order of the stones does not matter, that is, a stone from any position a_i can end up in at any position b_j, provided there is a required number of stones in each position (that is, if a coordinate x appears k times among numbers b_1, …, b_4, there should be exactly k stones at x in the end).

We are allowed to move stones with the following operation: choose two stones at distinct positions x and y with at least one stone each, and move one stone from x to 2y - x. In other words, the operation moves a stone to a symmetric position relative to some other stone. At any moment it is allowed to have any number of stones at the same position.

Find any sequence of operations that achieves the goal, or determine that it is impossible. The sequence does not have to be shortest, but it may contain at most 1000 operations.

Input

The first line contains four integers a_1, …, a_4 (-10^9 ≤ a_i ≤ 10^9) — initial coordinates of the stones. There may be multiple stones sharing the same coordinate.

The second line contains four integers b_1, …, b_4 (-10^9 ≤ b_i ≤ 10^9) — target coordinates of the stones. There may be multiple targets sharing the same coordinate.

Output

If there is no sequence of operations that achieves the goal, print a single integer -1. Otherwise, on the first line print a single integer k (0 ≤ k ≤ 1000) — the number of operations in your sequence. On the next k lines, describe the operations. The i-th of these lines should contain two integers x_i and y_i (x_i ≠ y_i) — coordinates of the moved stone and the center of symmetry stone for the i-th operation.

For each operation i, there should at least one stone in each of the coordinates x_i and y_i, and the resulting coordinate 2y_i - x_i must not exceed 10^{18} by absolute value.

If there are multiple suitable sequences, print any of them. It is guaranteed that if there is a suitable sequence of operations, then there is also a suitable sequence that satisfies all the additional requirement.

Examples

Input


0 1 2 3
3 5 6 8


Output


3
1 3
2 5
0 3


Input


0 0 0 0
1 1 1 1


Output


-1


Input


0 0 0 1
0 1 0 1


Output


-1

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
long long d, g, tmp;
long long a[4], b[4];
vector<pair<long long, long long> > ans[2];
long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; }
void move(long long *A, int x, int y, int id) {
  if (A[x] == A[y]) return;
  if (id) A[x] = 2 * A[y] - A[x];
  ans[id].push_back(make_pair(A[x], A[y]));
  if (!id) A[x] = 2 * A[y] - A[x];
}
long long dis(long long *A, int pos) {
  return min(A[pos] - A[0], A[3] - A[pos]);
}
void work(long long *A, int id) {
  while (A[3] > A[0] + 1) {
    long long del = (A[3] - A[0] + 3) / 4, d1 = dis(A, 1), d2 = dis(A, 2);
    while (d1 < del && d2 < del) {
      int x = d1 < d2 ? 1 : 2, y = A[x ^ 3] - A[0] < A[3] - A[x ^ 3];
      if (y)
        move(A, x, x - 1, id), move(A, x, (x + 1) % 3, id);
      else
        move(A, x, x + 1, id), move(A, x, (x + 1) % 3 + 1, id);
      sort(A, A + 4), d1 = dis(A, 1), d2 = dis(A, 2);
    }
    if (d1 >= del) {
      if (A[3] - A[1] >= A[1] - A[0])
        move(A, 0, 1, id);
      else
        move(A, 3, 1, id), move(A, 2, 1, id);
    } else {
      if (A[3] - A[2] >= A[1] - A[0])
        move(A, 3, 2, id);
      else
        move(A, 0, 2, id), move(A, 1, 2, id);
    }
    sort(A, A + 4);
  }
}
void work(long long *A, long long *B, int id) {
  long long len = (B[0] - A[0]) >> 1;
  while (A[3] - A[0] < len) {
    move(A, 2, 0, id);
    move(A, 1, 3, id);
    sort(A, A + 4);
  }
  while (true) {
    while (len >= A[3] - A[0]) {
      len -= A[3] - A[0];
      move(A, 1, 0, id), move(A, 2, 0, id);
      for (int i = 0; i < 3; i++) move(A, i, 3, id);
      move(A, 3, 0, id);
      sort(A, A + 4);
    }
    if (A[3] - A[0] <= 1) break;
    move(A, 0, 1, id), move(A, 3, 2, id);
    sort(A, A + 4);
  }
}
int main() {
  for (int i = 0; i < 4; i++) scanf("%lld", &a[i]);
  sort(a, a + 4);
  for (int i = 0; i < 4; i++) scanf("%lld", &b[i]);
  sort(b, b + 4);
  long long ga = 0, gb = 0;
  for (int i = 0; i < 3; i++)
    ga = gcd(a[i + 1] - a[i], ga), gb = gcd(b[i + 1] - b[i], gb);
  if (!ga && !gb) {
    if (a[0] == b[0])
      return puts("0"), 0;
    else
      puts("-1"), exit(0);
  }
  if (ga != gb || a[0] % ga != b[0] % gb) puts("-1"), exit(0);
  d = a[0] % ga, g = ga, tmp = 0;
  for (int i = 0; i < 4; i++) {
    a[i] = (a[i] - d) / g, b[i] = (b[i] - d) / g;
    tmp += a[i] & 1, tmp -= b[i] & 1;
  }
  if (tmp != 0) puts("-1"), exit(0);
  work(a, 0), work(b, 1);
  for (int i = 0; (a[i] & 1); i++) move(a, i, 3, 0);
  for (int i = 0; (b[i] & 1); i++) move(b, i, 3, 1);
  sort(a, a + 4);
  sort(b, b + 4);
  if (a[0] < b[0])
    work(a, b, 0);
  else
    work(b, a, 1);
  printf("%d\n", ans[0].size() + ans[1].size());
  for (int i = 0; i < ans[0].size(); i++)
    printf("%lld %lld\n", ans[0][i].first * g + d, ans[0][i].second * g + d);
  for (int i = ans[1].size() - 1; i >= 0; i--)
    printf("%lld %lld\n", ans[1][i].first * g + d, ans[1][i].second * g + d);
}