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[10], b[10], G1, G2;
vector<pair<long long, long long> > q1, q2;
long long gcd(long long x, long long y) { return y ? gcd(y, x % y) : x; }
void getopt(long long *a, vector<pair<long long, long long> > &vec) {
  for (;;) {
    sort(a + 1, a + 4 + 1);
    if (a[4] - a[1] == 1) break;
    long long P = -(1ll << 60);
    for (;;) {
      if (a[2] * 4 >= a[1] * 3 + a[4] && a[2] * 4 <= a[1] + a[4] * 3) P = a[2];
      if (a[3] * 4 >= a[1] * 3 + a[4] && a[3] * 4 <= a[1] + a[4] * 3) P = a[3];
      if (P != -(1ll << 60)) break;
      long long v1 = min(a[2] - a[1], a[4] - a[2]);
      long long v2 = min(a[3] - a[1], a[4] - a[3]);
      if (v1 > v2) swap(v1, v2), swap(a[2], a[3]);
      int id1 = 3, id2 = (a[4] - a[3] < a[3] - a[1] ? 4 : 1);
      if (id1 > id2) swap(id1, id2);
      if (a[4] - a[2] < a[2] - a[1]) swap(id1, id2);
      vec.push_back(pair<long long, long long>(a[2], a[id1]));
      a[2] = 2ll * a[id1] - a[2];
      vec.push_back(pair<long long, long long>(a[2], a[id2]));
      a[2] = 2ll * a[id2] - a[2];
    }
    if (2 * P <= a[1] + a[4]) {
      for (int i = (int)(1); i <= (int)(4); i++)
        if (a[i] < P) {
          vec.push_back(pair<long long, long long>(a[i], P));
          a[i] = 2ll * P - a[i];
        }
    } else {
      for (int i = (int)(1); i <= (int)(4); i++)
        if (a[i] > P) {
          vec.push_back(pair<long long, long long>(a[i], P));
          a[i] = 2ll * P - a[i];
        }
    }
  }
  sort(a + 1, a + 4 + 1);
  if (a[1] & 1)
    for (int i = (int)(1); i <= (int)(4); i++)
      if (a[i] & 1) {
        vec.push_back(pair<long long, long long>(a[i], a[i] + 1));
        a[i] += 2;
      }
  sort(a + 1, a + 4 + 1);
}
int main() {
  for (int i = (int)(1); i <= (int)(4); i++) scanf("%lld", &a[i]);
  for (int i = (int)(1); i <= (int)(4); i++) scanf("%lld", &b[i]);
  sort(a + 1, a + 4 + 1);
  sort(b + 1, b + 4 + 1);
  for (int i = (int)(2); i <= (int)(4); i++) G1 = gcd(G1, a[i] - a[1]);
  for (int i = (int)(2); i <= (int)(4); i++) G2 = gcd(G2, b[i] - b[1]);
  if (G1 != G2) return puts("-1"), 0;
  if (!G1) return puts(a[1] == b[1] ? "0" : "-1"), 0;
  if ((a[1] - b[1]) % G1) return puts("-1"), 0;
  long long G = G1, rem = (a[1] % G + G) % G;
  for (int i = (int)(1); i <= (int)(4); i++) a[i] = (a[i] - rem) / G;
  for (int i = (int)(1); i <= (int)(4); i++) b[i] = (b[i] - rem) / G;
  getopt(a, q1);
  getopt(b, q2);
  for (int i = (int)(1); i <= (int)(4); i++)
    if ((a[i] & 1) != (b[i] & 1)) return puts("-1"), 0;
  long long d = (b[1] - a[1]) / 2;
  for (; 3 * (a[4] - a[1]) <= abs(d);) {
    q1.push_back(pair<long long, long long>(a[3], a[1]));
    a[3] = 2 * a[1] - a[3];
    q1.push_back(pair<long long, long long>(a[2], a[4]));
    a[2] = 2 * a[4] - a[2];
    sort(a + 1, a + 4 + 1);
  }
  for (;;) {
    for (; abs(d) >= a[4] - a[1];)
      if (d < 0) {
        d += a[4] - a[1];
        for (int T = (int)(1); T <= (int)(2); T++) {
          for (int i = (int)(2); i <= (int)(4); i++) {
            q1.push_back(pair<long long, long long>(a[i], a[1]));
            a[i] = 2ll * a[1] - a[i];
          }
          sort(a + 1, a + 4 + 1);
        }
      } else {
        d -= a[4] - a[1];
        for (int T = (int)(1); T <= (int)(2); T++) {
          for (int i = (int)(1); i <= (int)(3); i++) {
            q1.push_back(pair<long long, long long>(a[i], a[4]));
            a[i] = 2ll * a[4] - a[i];
          }
          sort(a + 1, a + 4 + 1);
        }
      }
    if (a[4] - a[1] <= 1) break;
    q1.push_back(pair<long long, long long>(a[1], a[2]));
    a[1] = 2ll * a[2] - a[1];
    q1.push_back(pair<long long, long long>(a[4], a[3]));
    a[4] = 2ll * a[3] - a[4];
    sort(a + 1, a + 4 + 1);
  }
  for (int i = (int)(q2.size() - 1); i >= (int)(0); i--)
    q1.push_back(pair<long long, long long>(2 * q2[i].second - q2[i].first,
                                            q2[i].second));
  int top = 0;
  for (int i = (int)(0); i <= (int)(q1.size() - 1); i++) {
    q1[top].first = q1[i].first * G + rem;
    q1[top].second = q1[i].second * G + rem;
    if (q1[top].first != q1[top].second) ++top;
  }
  printf("%d\n", top);
  for (int i = (int)(0); i <= (int)(top - 1); i++)
    printf("%lld %lld\n", q1[i].first, q1[i].second);
}