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;
template <typename T1, typename T2>
inline void chkmin(T1 &x, T2 y) {
  if (x > y) x = y;
}
template <typename T1, typename T2>
inline void chkmax(T1 &x, T2 y) {
  if (x < y) x = y;
}
using ll = long long;
using ld = long double;
const string FILENAME = "input";
ll gcd(ll a, ll b) {
  while (b) {
    a %= b;
    swap(a, b);
  }
  return a;
}
pair<pair<ll, ll>, ll> sig(vector<ll> a) {
  ll r1 = a[1] - a[0];
  ll r2 = a[2] - a[1];
  ll r3 = a[3] - a[2];
  ll g = gcd(gcd(r1, r2), r3);
  if (g == 0) {
    return {{0, a[0]}, 0};
  }
  ll f = ((a[0] % g) + g) % g;
  ll res = 0;
  for (int j = 0; j < 4; j++) {
    res += ((a[j] - f) / g) & 1;
  }
  return {{g, f}, res};
}
bool inside(ll x, ll a, ll b) {
  return (a <= x && x <= b) || (b <= x && x <= a);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  function<void(vector<ll> &, vector<pair<ll, ll> > &)> solve;
  solve = [&](vector<ll> &v, vector<pair<ll, ll> > &moves) {
    auto make = [&](int i, int j) {
      moves.push_back({v[i], v[j]});
      v[i] = 2 * v[j] - v[i];
    };
    while (true) {
      sort((v).begin(), (v).end());
      if (v[0] == v[3]) {
      } else if (v[0] + 1 < v[3]) {
        ll target = (v[3] - v[0]) / 8;
        for (int j = 1; j <= 2; j++) {
          if (v[j] - v[0] > target && v[3] - v[j] > target) {
            if (v[3] - v[j] > v[j] - v[0]) {
              make(0, j);
              goto done;
            } else {
              make(3, j);
              goto done;
            }
          }
        }
        if (v[1] - v[0] > target) {
          make(3, 1);
          continue;
        }
        if (v[3] - v[2] > target) {
          make(0, 2);
          continue;
        }
        if (v[2] - v[1] > target) {
          if (v[1] - v[0] > v[3] - v[2]) {
            make(2, 1);
            make(2, 0);
            continue;
          } else {
            make(1, 2);
            make(1, 3);
            continue;
          }
        }
      } else if (v[0] == 0) {
      } else if (v[3] == 0 && v[0] < 0) {
        for (int i = 0; i < 3; i++) {
          make(i, 3);
        }
        continue;
      } else if (v[1] != v[2]) {
        if (v[0] > 0 && v[0] == v[2]) {
          make(3, 0);
          sort((v).begin(), (v).end());
        }
        if (v[3] < 0 && v[1] == v[3]) {
          make(0, 3);
          sort((v).begin(), (v).end());
        }
        while (v[3] < 0) {
          make(1, 3);
          sort((v).begin(), (v).end());
        }
        while (v[0] > 0) {
          make(2, 0);
          sort((v).begin(), (v).end());
        }
        while (v[0] + 1 < v[3]) {
          if (v[2] >= 0) {
            make(3, 2);
            sort((v).begin(), (v).end());
          } else if (v[1] <= 0) {
            make(0, 1);
            sort((v).begin(), (v).end());
          }
        }
        continue;
      } else {
        if (v[0] == v[2] && v[3] > 0) {
          make(3, 0);
        }
        if (v[1] == v[3] && v[0] < 0) {
          make(0, 3);
        }
        sort((v).begin(), (v).end());
        bool flag = false;
        if (v[0] != v[2]) {
          flag = true;
        }
        if (flag) {
          reverse((v).begin(), (v).end());
        }
        while (!inside(0, v[0], v[3])) {
          make(1, 3);
          sort((v).begin(), (v).end());
          if (flag) {
            reverse((v).begin(), (v).end());
          }
        }
        while (abs(v[0] - v[3]) > 1) {
          make(3, 2);
          sort((v).begin(), (v).end());
          if (flag) {
            reverse((v).begin(), (v).end());
          }
          while (!inside(0, v[0], v[3])) {
            make(0, 3);
            make(1, 3);
            make(2, 3);
            flag = !flag;
          }
        }
        sort((v).begin(), (v).end());
        continue;
      }
      break;
    done:;
      continue;
    }
  };
  vector<vector<ll> > a(2, vector<ll>(4));
  for (int x = 0; x < 2; x++) {
    for (int i = 0; i < 4; i++) {
      cin >> a[x][i];
    }
    sort((a[x]).begin(), (a[x]).end());
  }
  if (sig(a[0]) != sig(a[1])) {
    cout << -1 << '\n';
    return 0;
  }
  ll g = sig(a[0]).first.first;
  ll f = sig(a[0]).first.second;
  if (g == 0) {
    cout << 0 << '\n';
    return 0;
  }
  for (int j = 0; j < 2; j++) {
    for (auto &x : a[j]) {
      x = (x - f) / g;
    }
  }
  vector<vector<pair<ll, ll> > > moves(2);
  solve(a[0], moves[0]);
  solve(a[1], moves[1]);
  for (auto &x : moves[1]) {
    x.first = x.second * 2 - x.first;
  }
  reverse((moves[1]).begin(), (moves[1]).end());
  moves[0].insert(moves[0].end(), (moves[1]).begin(), (moves[1]).end());
  vector<pair<ll, ll> > res;
  for (auto x : moves[0]) {
    if (x.first == x.second) {
      continue;
    }
    res.push_back(x);
  }
  cout << (int)(res).size() << '\n';
  for (auto x : res) {
    if (x.first == x.second) {
      continue;
    }
    cout << x.first * g + f << ' ' << x.second * g + f << '\n';
  }
}