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>
long long a[4], b[4];
long long gcd(long long x, long long y) {
  long long r;
  while (y) {
    r = x % y;
    x = y;
    y = r;
  }
  return x;
}
std::vector<std::pair<long long, long long> > F(std::vector<long long> a) {
  std::vector<std::pair<long long, long long> > result;
  while (a[0] < 0 || a[3] > 1) {
    bool ok = false;
    for (int i = 0; i < 3; i++)
      if ((a[3] - a[i]) * 3 >= a[i] && a[i] * 2 - a[3] >= 0) {
        result.push_back({a[3], a[i]});
        a[3] = a[i] * 2 - a[3];
        std::sort(a.begin(), a.end());
        ok = true;
        break;
      }
    if (ok) continue;
    for (int i = 0; i < 3; i++) {
      for (int j = i + 1; j < 3; j++)
        if ((a[j] - a[i]) * 2 <= a[3] && (a[j] - a[i]) * 6 >= a[3]) {
          result.push_back({a[3], a[j]});
          result.push_back({a[j] * 2 - a[3], a[i]});
          a[3] -= (a[j] - a[i]) * 2;
          std::sort(a.begin(), a.end());
          ok = true;
          break;
        }
      if (ok) break;
    }
    if (ok) continue;
    if (a[0] * 2 > a[3]) {
      result.push_back({a[3], a[0]});
      a[3] = a[0] * 2 - a[3];
      std::sort(a.begin(), a.end());
      continue;
    }
    if (a[1] * 2 > a[3]) {
      result.push_back({a[3], a[1]});
      a[3] = a[1] * 2 - a[3];
      std::sort(a.begin(), a.end());
      continue;
    }
    if (a[2] * 2 > a[3]) {
      if (a[1] - a[0] > a[3] - a[2]) {
        result.push_back({a[2], a[1]});
        result.push_back({a[1] * 2 - a[2], a[0]});
        a[2] -= (a[1] - a[0]) * 2;
        std::sort(a.begin(), a.end());
        continue;
      } else {
        result.push_back({a[1], a[2]});
        result.push_back({a[2] * 2 - a[1], a[3]});
        a[1] += (a[3] - a[2]) * 2;
        std::sort(a.begin(), a.end());
        continue;
      }
    }
    result.push_back({a[0], a[2]});
    a[0] = a[2] * 2 - a[0];
    std::sort(a.begin(), a.end());
  }
  return result;
}
int main() {
  for (int i = 0; i < 4; i++) scanf("%lld", a + i);
  for (int i = 0; i < 4; i++) scanf("%lld", b + i);
  std::sort(a, a + 4);
  std::sort(b, b + 4);
  if (a[0] == a[3]) {
    if (b[0] != a[0] || b[3] != a[3])
      puts("-1");
    else
      puts("0");
    return 0;
  }
  if (b[0] == b[3]) {
    puts("-1");
    return 0;
  }
  long long ga = gcd(gcd(a[1] - a[0], a[2] - a[0]), a[3] - a[0]);
  long long gb = gcd(gcd(b[1] - b[0], b[2] - b[0]), b[3] - b[0]);
  long long ra = (a[0] % ga + ga) % ga;
  long long rb = (b[0] % gb + gb) % gb;
  if (ga != gb || ra != rb) {
    puts("-1");
    return 0;
  }
  ra = std::min(a[0], b[0]);
  for (int i = 0; i < 4; i++) a[i] = (a[i] - ra) / ga;
  for (int i = 0; i < 4; i++) b[i] = (b[i] - ra) / ga;
  int odda = 0, oddb = 0;
  for (int i = 0; i < 4; i++) odda += a[i] & 1;
  for (int i = 0; i < 4; i++) oddb += b[i] & 1;
  if (odda != oddb) {
    puts("-1");
    return 0;
  }
  std::vector<std::pair<long long, long long> > va = F({a, a + 4}),
                                                vb = F({b, b + 4});
  printf("%d\n", int(va.size()) + int(vb.size()));
  for (auto i = va.begin(); i != va.end(); i++)
    printf("%lld %lld\n", i->first * ga + ra, i->second * ga + ra);
  for (auto i = vb.rbegin(); i != vb.rend(); i++)
    printf("%lld %lld\n", (i->second * 2 - i->first) * ga + ra,
           i->second * ga + ra);
  return 0;
}