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[5], b[5];
long long gcd(long long a, long long b) { return (!b) ? a : gcd(b, a % b); }
long long Abs(long long x) { return (x < 0) ? -x : x; }
long long getgcd(long long *a) {
  long long ans = 0;
  for (long long i = 1; i <= 4; i++)
    for (long long j = 1; j <= 4; j++) ans = gcd(ans, Abs(a[i] - a[j]));
  return ans;
}
struct info {
  info() { ope.clear(), p.clear(); }
  std::vector<std::pair<long long, long long> > ope, p;
  void flip(long long x, long long y) {
    ope.push_back(std::make_pair(p[x].first, p[y].first));
    p[x].first = (p[y].first << 1) - p[x].first;
  }
  std::pair<long long, long long> &operator[](long long n) { return p[n]; }
};
std::vector<std::pair<long long, long long> > ans;
info compress(long long *a) {
  info ans;
  for (long long i = 1; i <= 4; i++) ans.p.push_back(std::make_pair(a[i], i));
  for (;;) {
    std::sort(ans.p.begin(), ans.p.end());
    if (ans[0].first == ans[3].first - 1) break;
    long long old = (ans[3].first - ans[0].first);
    long long l, r;
    l = ans[1].first,
    r = std::max(ans[3].first, (ans[1].first << 1) - ans[0].first);
    if (((r - l) << 2) <= (ans[3].first - ans[0].first) * 3) {
      ans.flip(0, 1);
      continue;
    }
    r = ans[2].first,
    l = std::min(ans[0].first, (ans[2].first << 1) - ans[3].first);
    if (((r - l) << 2) <= (ans[3].first - ans[0].first) * 3) {
      ans.flip(3, 2);
      continue;
    }
    {
      long long d1 = ans[3].first - ans[2].first,
                d0 = ans[1].first - ans[0].first,
                tot = ans[3].first - ans[0].first;
      if (d1 < (tot >> 2) && d0 < (tot >> 2)) {
        ans.flip(0, 3);
        ans.flip(1, 2);
        ans.flip(2, 3);
      } else if (d1 > d0) {
        ans.flip(2, 3);
        ans.flip(1, 2);
        ans.flip(1, 3);
        ans.flip(2, 3);
      } else {
        ans.flip(1, 0);
        ans.flip(2, 1);
        ans.flip(2, 0);
        ans.flip(1, 0);
      }
    }
  }
  if (ans[0].first & 1) {
    ans.flip(0, 3);
    ans.flip(1, 3);
    ans.flip(2, 3);
  }
  std::sort(ans.p.begin(), ans.p.end());
  return ans;
}
info move(std::vector<std::pair<long long, long long> > pos1,
          std::vector<std::pair<long long, long long> > pos2) {
  info ans;
  ans.p = pos1;
  long long delta = pos2[0].first - pos1[0].first, l = 0;
  std::vector<std::pair<long long, long long> > tem;
  for (;;) {
    std::sort(ans.p.begin(), ans.p.end());
    if (ans[3].first - ans[0].first > Abs(delta)) break;
    ++l;
    ans.flip(2, 0);
    ans.flip(1, 3);
  }
  for (;;) {
    std::sort(ans.p.begin(), ans.p.end());
    long long change = (ans[3].first - ans[0].first) << 1;
    for (;;) {
      if (delta >= change) {
        ans.flip(0, 3);
        ans.flip(1, 3);
        ans.flip(2, 3);
        ans.flip(3, 0);
        ans.flip(2, 0);
        ans.flip(1, 0);
        delta -= change;
      } else if (delta <= -change) {
        ans.flip(1, 0);
        ans.flip(2, 0);
        ans.flip(3, 0);
        ans.flip(2, 3);
        ans.flip(1, 3);
        ans.flip(0, 3);
        delta += change;
      } else
        break;
    }
    if (l) {
      --l;
      ans.flip(0, 1);
      ans.flip(3, 2);
    } else
      break;
  }
  return ans;
}
void add(std::vector<std::pair<long long, long long> > tem) {
  for (long long i = 0; i < tem.size(); i++)
    if (tem[i].first != tem[i].second) ans.push_back(tem[i]);
}
signed main() {
  for (long long i = 1; i <= 4; i++) scanf("%lld", a + i);
  for (long long i = 1; i <= 4; i++) scanf("%lld", b + i);
  long long _gcd = getgcd(a);
  if (!_gcd) {
    if (getgcd(b) == 0 && b[1] == a[1])
      puts("0");
    else
      puts("-1");
    return 0;
  }
  long long x = ((a[1] % _gcd) + _gcd) % _gcd;
  if (_gcd != getgcd(b) ||
      (b[1] % _gcd + _gcd) % _gcd != (a[1] % _gcd + _gcd) % _gcd) {
    puts("-1");
    return 0;
  }
  for (long long i = 1; i <= 4; i++) (a[i] -= x) /= _gcd, (b[i] -= x) /= _gcd;
  long long cnt = 0;
  for (long long i = 1; i <= 4; i++) cnt += (a[i] & 1) - (b[i] & 1);
  if (cnt) {
    puts("-1");
    return 0;
  }
  for (long long i = 1; i <= 4; i++)
    if ((a[i] + b[i]) & 1) {
      for (long long j = i + 1; j <= 4; j++)
        if ((b[j] & 1) == (a[i] & 1)) {
          std::swap(b[i], b[j]);
          break;
        }
    }
  auto nowa = compress(a), nowb = compress(b);
  add(nowa.ope);
  add(move(nowa.p, nowb.p).ope);
  std::reverse(nowb.ope.begin(), nowb.ope.end());
  for (long long i = 0; i < nowb.ope.size(); i++) {
    nowb.ope[i].first = (nowb.ope[i].second << 1) - nowb.ope[i].first;
  }
  add(nowb.ope);
  printf("%d\n", ans.size());
  for (long long i = 0; i < ans.size(); i++)
    printf("%lld %lld\n", ans[i].first * _gcd + x, ans[i].second * _gcd + x);
}