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;
vector<pair<long long, long long> > v1, v2, v3;
long long a[5], b[5], d;
long long gcd(long long a, long long b) { return !b ? a : gcd(b, a % b); }
void op(long long *a, vector<pair<long long, long long> > &mov, long long p1,
        long long p2) {
  mov.push_back(make_pair(a[p1], a[p2]));
  a[p1] = a[p2] * 2 - a[p1];
}
void solve(long long *a, vector<pair<long long, long long> > &mov) {
  while (true) {
    sort(a + 1, a + 5);
    if (a[1] + 1 == a[4]) break;
    while (min(a[2] - a[1], a[4] - a[2]) * 4 < a[4] - a[1] &&
           min(a[3] - a[1], a[4] - a[3]) * 4 < a[4] - a[1]) {
      long long p, q, q1, q2;
      if (min(a[2] - a[1], a[4] - a[2]) < min(a[3] - a[1], a[4] - a[3]))
        p = 2, q = 3;
      else
        p = 3, q = 2;
      if (a[q] - a[1] < a[4] - a[q])
        q1 = 1, q2 = q;
      else
        q1 = q, q2 = 4;
      if (a[p] - a[1] < a[4] - a[p])
        op(a, mov, p, q1), op(a, mov, p, q2);
      else
        op(a, mov, p, q2), op(a, mov, p, q1);
    }
    sort(a + 1, a + 5);
    if (min(a[2] - a[1], a[4] - a[2]) * 4 >= a[4] - a[1]) {
      if (a[2] - a[1] < a[4] - a[2])
        op(a, mov, 1, 2);
      else
        op(a, mov, 3, 2), op(a, mov, 4, 2);
    } else {
      if (a[3] - a[1] < a[4] - a[3])
        op(a, mov, 1, 3), op(a, mov, 2, 3);
      else
        op(a, mov, 4, 3);
    }
  }
  sort(a + 1, a + 5);
  if (a[1] & 1)
    for (long long i = 1; i <= 3; i++)
      if (a[i] < a[4]) op(a, mov, i, 4);
  sort(a + 1, a + 5);
}
void shift() {
  sort(a + 1, a + 5);
  if ((a[4] - a[1]) * 3 < abs(d)) {
    op(a, v3, 3, 1);
    op(a, v3, 2, 4);
    shift();
    sort(a + 1, a + 5);
    op(a, v3, 1, 2);
    op(a, v3, 4, 3);
  }
  sort(a + 1, a + 5);
  while (a[4] - a[1] <= abs(d)) {
    if (d > 0) {
      d -= a[4] - a[1];
      op(a, v3, 2, 1);
      op(a, v3, 2, 4);
      op(a, v3, 3, 1);
      op(a, v3, 3, 4);
      op(a, v3, 1, 4);
      op(a, v3, 4, 1);
    } else {
      d += a[4] - a[1];
      op(a, v3, 2, 4);
      op(a, v3, 2, 1);
      op(a, v3, 3, 4);
      op(a, v3, 3, 1);
      op(a, v3, 4, 1);
      op(a, v3, 1, 4);
    }
    sort(a + 1, a + 5);
  }
}
void purify(vector<pair<long long, long long> > &vec) {
  vector<pair<long long, long long> > tmp;
  for (pair<long long, long long> p : vec)
    if (p.first != p.second) tmp.push_back(p);
  vec = tmp;
}
signed main() {
  for (long long i = 1; i <= 4; i++) cin >> a[i];
  sort(a + 1, a + 5);
  for (long long i = 1; i <= 4; i++) cin >> b[i];
  sort(b + 1, b + 5);
  long long g = gcd(gcd(a[2] - a[1], a[3] - a[1]), a[4] - a[1]);
  if (gcd(gcd(b[2] - b[1], b[3] - b[1]), b[4] - b[1]) != g) {
    cout << -1;
    return 0;
  }
  bool e1 = a[1] == a[2] && a[2] == a[3] && a[3] == a[4],
       e2 = b[1] == b[2] && b[2] == b[3] && b[3] == b[4];
  if (e1 && e2) {
    if (a[1] != b[1])
      cout << -1;
    else
      cout << 0;
    return 0;
  }
  if (e1 || e2) {
    cout << -1;
    return 0;
  }
  if ((a[1] % g + g) % g != (b[1] % g + g) % g) {
    cout << -1;
    return 0;
  }
  long long delta = (a[1] % g + g) % g;
  for (long long i = 1; i <= 4; i++)
    a[i] = (a[i] - delta) / g, b[i] = (b[i] - delta) / g;
  long long c1[2] = {0}, c2[2] = {0};
  for (long long i = 1; i <= 4; i++) c1[abs(a[i]) & 1]++, c2[abs(b[i]) & 1]++;
  if (c1[0] != c2[0] || c1[1] != c2[1]) {
    cout << -1;
    return 0;
  }
  solve(a, v1);
  solve(b, v2);
  d = (b[1] - a[1]) / 2;
  shift();
  purify(v1);
  purify(v2);
  purify(v3);
  cout << v1.size() + v2.size() + v3.size() << '\n';
  for (pair<long long, long long> p : v1)
    cout << p.first * g + delta << ' ' << p.second * g + delta << '\n';
  for (pair<long long, long long> p : v3)
    cout << p.first * g + delta << ' ' << p.second * g + delta << '\n';
  long long siz = v2.size();
  for (long long i = siz - 1; i >= 0; i--)
    cout << (2 * v2[i].second - v2[i].first) * g + delta << ' '
         << v2[i].second * g + delta << '\n';
  return 0;
}