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;
multiset<long long> pos[2];
vector<pair<long long, long long> > ans[2];
long long gcd(long long a, long long b) { return (b == 0 ? a : gcd(b, a % b)); }
void make(int it, long long a, long long b) {
  if (a == b) {
    return;
  }
  ans[it].push_back(make_pair(a, b));
  pos[it].erase(pos[it].find(a));
  pos[it].insert(2 * b - a);
}
void print(int it) {
  cout << "SET " << it << ": ";
  for (auto itr : pos[it]) {
    cout << itr << ' ';
  }
  cout << endl;
}
int sum(int it) {
  int x = 0;
  for (auto itr : pos[it]) {
    x += itr & 1;
  }
  return x;
}
int main() {
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  pos[0].insert(a);
  pos[0].insert(b);
  pos[0].insert(c);
  pos[0].insert(d);
  long long g0 = gcd(gcd(abs(d - a), abs(c - a)), abs(b - a));
  long long c0 = (abs(b - a) & 1) ^ (abs(c - a) & 1) ^ (abs(d - a) & 1);
  cin >> a >> b >> c >> d;
  pos[1].insert(a);
  pos[1].insert(b);
  pos[1].insert(c);
  pos[1].insert(d);
  long long g1 = gcd(gcd(abs(d - a), abs(c - a)), abs(b - a));
  long long c1 = (abs(b - a) & 1) ^ (abs(c - a) & 1) ^ (abs(d - a) & 1);
  if (g0 != g1 || c0 != c1) {
    cout << -1 << endl;
    return 0;
  }
  if (g0 == 0) {
    if ((*pos[0].begin()) != (*pos[1].begin())) {
      cout << -1 << endl;
    } else {
      cout << 0 << endl;
    }
    return 0;
  }
  if (((*pos[0].begin()) - (*pos[1].begin())) % g0 != 0) {
    cout << -1 << endl;
    return 0;
  }
  long long sd = (*pos[0].begin()) % g0;
  if (sd < 0) {
    sd += g0;
  }
  for (int it = 0; it < 2; it++) {
    multiset<long long> nx;
    for (long long x : pos[it]) {
      nx.insert((x - sd) / g0);
    }
    pos[it] = nx;
  }
  for (int it = 0; it < 2; it++) {
    while ((*pos[it].rbegin()) - (*pos[it].begin()) >= 3) {
      auto itr = pos[it].begin();
      long long a = *itr;
      itr++;
      long long b = *itr;
      itr++;
      long long c = *itr;
      itr++;
      long long d = *itr;
      long long len = d - a;
      long long x = min(c - a, d - c);
      if (x >= len / 6 && x != 0) {
        make(it, d, c);
      } else {
        long long y = min(b - a, d - b);
        if (y >= len / 6 && x != 0) {
          make(it, d, b);
        } else {
          if (c - a < len / 6) {
            make(it, b, a);
            make(it, 2 * a - b, c);
          } else if (d - b < len / 6) {
            make(it, c, d);
            make(it, 2 * d - c, b);
          } else if (b - a < d - c) {
            make(it, b, c);
            make(it, 2 * c - b, d);
          } else {
            make(it, c, b);
            make(it, 2 * b - c, a);
          }
        }
      }
    }
  }
  for (int it = 0; it < 2; it++) {
    auto itr = pos[it].begin();
    long long a = *itr;
    itr++;
    long long b = *itr;
    itr++;
    long long c = *itr;
    itr++;
    long long d = *itr;
    if (a == b) {
      if (c != a) {
        make(it, b, c);
      } else {
        make(it, b, d);
      }
      it--;
      continue;
    }
    if (d == b) {
      make(it, b, a);
    }
  }
  if (sum(0) != sum(1)) {
    cout << -1 << endl;
    return 0;
  }
  int it = 0;
  if ((*pos[1].begin()) > (*pos[0].begin())) {
    it = 1;
  }
  while ((*pos[it].begin()) - (*pos[it ^ 1].begin()) >= 6) {
    long long d = (*pos[it].begin()) - (*pos[it ^ 1].begin());
    int cnt = 0;
    long long x = *pos[it].rbegin();
    long long sum = 0;
    while (true) {
      long long a = *pos[it].begin();
      long long c = *pos[it].rbegin();
      cnt++;
      auto itr = pos[it].rbegin();
      while ((*itr) == c) {
        itr++;
      }
      long long b = *itr;
      sum += c - b;
      if (2 * (x - b) + (b - (2 * a - c)) > d) {
        cnt--;
        break;
      }
      while (pos[it].count(c)) {
        make(it, c, a);
      }
    }
    long long cc = *pos[it].rbegin();
    auto itr = pos[it].rbegin();
    while ((*itr) == cc) {
      itr++;
    }
    long long bb = *itr;
    long long ds = d - (x - cc);
    sum += bb - (*pos[it].begin());
    sum -= 2;
    ds -= sum;
    int tp = 0;
    while (cnt > 0) {
      long long a = *pos[it].begin();
      long long c = *pos[it].rbegin();
      auto itr = pos[it].rbegin();
      while ((*itr) == c) {
        itr++;
      }
      long long b = *itr;
      if (ds >= (c - a)) {
        ds -= (c - a);
        while (pos[it].count(c)) {
          make(it, c, a);
        }
        while (pos[it].count(b)) {
          make(it, b, a);
        }
        tp ^= 1;
      } else {
        cnt--;
        if (tp == 0) {
          ds += (b - a);
          ds += (b - a) - (c - b);
          sum -= b - a;
          while (pos[it].count(a)) {
            make(it, a, b);
          }
        } else {
          while (pos[it].count(c)) {
            make(it, c, b);
          }
          sum -= c - b;
        }
      }
    }
  }
  for (int it = 0; it < 2; it++) {
    auto itr = pos[it].begin();
    long long a = *itr;
    itr++;
    long long b = *itr;
    itr++;
    long long c = *itr;
    itr++;
    long long d = *itr;
    if (a == b) {
      if (c != a) {
        make(it, b, c);
      } else {
        make(it, b, d);
      }
      it--;
      continue;
    }
    if (d == b) {
      make(it, b, a);
    }
  }
  while ((*pos[0].begin()) != (*pos[1].begin())) {
    int cnt = pos[it].count(*pos[it].rbegin());
    long long x = *pos[it].rbegin();
    if (cnt == 1) {
      make(it, x, x - 1);
      make(it, x - 1, x - 2);
    } else {
      make(it, x, x - 1);
      make(it, x, x - 1);
      make(it, x - 1, x - 2);
      make(it, x - 2, x - 3);
    }
  }
  while (!ans[1].empty()) {
    pair<long long, long long> g = ans[1].back();
    ans[1].pop_back();
    ans[0].push_back(make_pair(2 * g.second - g.first, g.second));
  }
  if (ans[0].size() > 1000) {
    throw 1;
  }
  cout << ans[0].size() << endl;
  for (pair<long long, long long> g : ans[0]) {
    cout << (g.first) * g0 + sd << ' ' << (g.second) * g0 + sd << endl;
  }
}