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 a[4], b[4];
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
void move(long long *a, vector<pair<long long, long long> > &A, int p, int q) {
  A.push_back(pair<long long, long long>(a[p], a[q]));
  a[p] = 2 * a[q] - a[p];
  sort(a, a + 4);
}
void undo(long long *a, pair<long long, long long> op,
          vector<pair<long long, long long> > &A, long long shf) {
  op.first += shf, op.second += shf;
  long long x = op.second * 2 - op.first, y = op.second;
  for (int i = 0; i < 4; i++)
    if (a[i] == x) {
      a[i] = op.first;
      break;
    }
  A.push_back(pair<long long, long long>(x, y));
  sort(a, a + 4);
}
long long shrink(long long *a, vector<pair<long long, long long> > &A) {
  while (a[3] - a[0] > 1) {
    long long dt = a[3] - a[0];
    long long l = a[0] + dt / 4, r = a[0] + 3 * dt / 4;
    if (l == a[0]) ++l;
    if (r == a[3]) --r;
    if (a[1] < l && a[2] < l) {
      while ((a[1] < l || a[1] > r) && (a[2] < l || a[2] > r)) {
        move(a, A, 1, 0);
        move(a, A, 0, 2);
      }
    } else if (a[1] > r && a[2] > r) {
      while ((a[1] < l || a[1] > r) && (a[2] < l || a[2] > r)) {
        move(a, A, 2, 3);
        move(a, A, 3, 1);
      }
    } else {
      while ((a[1] < l || a[1] > r) && (a[2] < l || a[2] > r)) {
        if (a[3] - a[2] > a[1] - a[0]) {
          move(a, A, 1, 2);
          move(a, A, 3, 2);
        } else {
          move(a, A, 2, 1);
          move(a, A, 0, 1);
        }
      }
    }
    if (l <= a[1] && a[1] <= r)
      move(a, A, 0, 1);
    else
      move(a, A, 0, 2);
  }
  while (a[0] & 1) {
    for (int i = 1; i < 4; i++)
      if (a[i] == a[0] + 1) {
        move(a, A, 0, i);
        break;
      }
  }
  return a[0];
}
int main() {
  for (int i = 0; i < 4; i++) scanf("%lld", &a[i]);
  for (int i = 0; i < 4; i++) scanf("%lld", &b[i]);
  sort(a, a + 4), sort(b, b + 4);
  bool o = true;
  for (int i = 1; i < 4; i++) o &= a[i] == a[i - 1];
  if (o) {
    for (int i = 0; i < 4; i++)
      if (a[0] != b[i]) return puts("-1"), 0;
    return puts("0"), 0;
  }
  long long x = 0, y = 0;
  for (int i = 1; i < 4; i++)
    x = gcd(x, a[i] - a[i - 1]), y = gcd(y, b[i] - b[i - 1]);
  if (x != y) return puts("-1"), 0;
  long long p = a[0] % x, q = b[0] % x;
  if (p != q) return puts("-1"), 0;
  for (int i = 0; i < 4; i++) a[i] = (a[i] - p) / x, b[i] = (b[i] - p) / x;
  int ck = 0, dk = 0;
  for (int i = 0; i < 4; i++)
    ck += (a[i] & 1) - (b[i] & 1), dk += (a[i] & 1 ^ 1) - (b[i] & 1 ^ 1);
  if (ck || dk) return puts("-1"), 0;
  vector<pair<long long, long long> > A, B, C;
  long long L = shrink(a, A);
  long long R = shrink(b, B);
  if (L <= R) {
    long long d = (R - L) >> 1;
    vector<pair<long long, long long> > S;
    while (a[3] - a[0] < d)
      move(a, S, 2, 0), C.push_back(S.back()), move(a, S, 2, 3),
          C.push_back(S.back());
    long long dt = 0;
    while (d) {
      while (a[3] - a[0] > d) {
        undo(a, S.back(), C, dt);
        S.pop_back();
      }
      while (a[3] - a[0] <= d) {
        d -= a[3] - a[0];
        dt += (a[3] - a[0]) * 2;
        move(a, C, 1, 0);
        move(a, C, 0, 3);
        move(a, C, 1, 0);
        move(a, C, 0, 2);
        move(a, C, 0, 1);
        move(a, C, 0, 1);
      }
    }
    d = R - L;
    while (S.size()) undo(a, S.back(), C, dt), S.pop_back();
  } else {
    long long d = (L - R) >> 1;
    vector<pair<long long, long long> > S;
    while (a[3] - a[0] < d)
      move(a, S, 2, 0), C.push_back(S.back()), move(a, S, 2, 3),
          C.push_back(S.back());
    long long dt = 0;
    while (d) {
      while (a[3] - a[0] > d) {
        undo(a, S.back(), C, dt);
        S.pop_back();
      }
      while (a[3] - a[0] <= d) {
        d -= a[3] - a[0];
        dt -= (a[3] - a[0]) * 2;
        move(a, C, 2, 3);
        move(a, C, 3, 0);
        move(a, C, 2, 3);
        move(a, C, 3, 1);
        move(a, C, 3, 2);
        move(a, C, 3, 2);
      }
    }
    d = R - L;
    while (S.size()) undo(a, S.back(), C, dt), S.pop_back();
  }
  vector<pair<long long, long long> > ans;
  for (pair<long long, long long> z : A) ans.push_back(z);
  for (pair<long long, long long> z : C) ans.push_back(z);
  for (int z = B.size() - 1; ~z; z--) undo(a, B[z], ans, 0);
  vector<pair<long long, long long> > fx;
  for (pair<long long, long long> z : ans)
    if (z.first != z.second)
      fx.push_back(
          pair<long long, long long>(z.first * x + p, z.second * x + p));
  cout << fx.size() << '\n';
  for (pair<long long, long long> z : fx)
    cout << z.first << " " << z.second << '\n';
  return 0;
}