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;
vector<pair<long long, long long> > op, oa;
vector<int> x[2];
void no() {
  printf("-1\n");
  exit(0);
}
struct S {
  vector<pair<long long, char> > v;
  S() {}
  S(vector<int> const &x) {
    for (int i = 0; i < (int)(4); ++i) v.emplace_back(x[i], 1);
    sr();
    if (v.size() == 1) no();
  }
  void sr() {
    sort(v.begin(), v.end());
    for (int i = 1; i < (int)(v.size()); ++i)
      if (v[i].first == v[i - 1].first) {
        v[i - 1].second += v[i].second;
        v.erase(v.begin() + i);
        --i;
      }
  }
  void mv1(int x, int y) {
    op.emplace_back(v[x].first, v[y].first);
    --v[x].second;
    v.emplace_back(v[y].first * 2 - v[x].first, 1);
    sr();
  }
  void mv(int x, int y) {
    for (int i = 0; i < (int)(v[x].second); ++i)
      op.emplace_back(v[x].first, v[y].first);
    v[x].first = v[y].first * 2 - v[x].first;
    sr();
  }
  void open() {
    while (v.size() < 4) {
      for (int i = 0; i < (int)(v.size()); ++i)
        if (v[i].second > 1) {
          if (i)
            mv1(i, 0);
          else
            mv1(0, v.size() - 1);
          break;
        }
    }
  }
  void kl() {
    while (v.size() == 4) {
      long long a = v[1].first - v[0].first, b = v[2].first - v[1].first,
                c = v[3].first - v[2].first;
      long long mx = max(a, max(b, c)), mn = a + b + c - mx;
      if (mn >= mx) {
        if (a == b)
          mv(3, 2);
        else if (b == c)
          mv(0, 1);
        else if (a + b == c)
          mv(0, 1);
        else if (a == b + c)
          mv(3, 2);
        else
          mv(0, 1);
      } else if (b > a && b > c) {
        mv(0, 3), mv(0, 1);
        if (b == c * 2)
          mv(3, 2);
        else
          mv(0, 1);
      } else if (a > b && a > c)
        mv(3, 1);
      else
        mv(0, 2);
    }
  }
  map<int, int> gtst() {
    map<int, int> an;
    long long md = v[1].first - v[0].first << 1;
    for (int i = 0; i < (int)(v.size()); ++i)
      an[(v[i].first % md + md) % md] += v[i].second;
    return an;
  }
  void go(long long x) {
    int g = v[1].first - v[0].first;
    while (x - v[2].first > g) {
      long long a = v[1].first - v[0].first, b = v[2].first - v[1].first,
                c = x - v[2].first;
      if (a + b <= c)
        mv(0, 2);
      else if (a <= b + c)
        mv(0, 1);
      else
        mv(2, 1);
    }
    while (v[0].first - x > g) {
      long long a = v[2].first - v[1].first, b = v[1].first - v[0].first,
                c = v[0].first - x;
      if (a + b <= c)
        mv(2, 0);
      else if (a <= b + c)
        mv(2, 1);
      else
        mv(0, 1);
    }
  }
  void pr() {
    for (int i = 0; i < (int)(v.size()); ++i) printf("%lld ", v[i].first);
    printf("\n");
  }
};
void sc(vector<int> &v) {
  v.resize(4);
  for (int i = 0; i < (int)(4); ++i) scanf("%d", &v[i]);
}
int main() {
  for (int i = 0; i < (int)(2); ++i) sc(x[i]);
  if (x[0] == x[1]) {
    printf("0\n");
    return 0;
  }
  S a(x[0]);
  a.open();
  a.kl();
  a.mv(0, 1);
  swap(op, oa);
  S b(x[1]);
  b.open();
  b.kl();
  if (a.v[1].first - a.v[0].first != b.v[1].first - b.v[0].first) no();
  if (a.gtst() != b.gtst()) no();
  b.go(a.v[0].first);
  while (b.v[0].first != a.v[0].first || b.v.back().first != a.v[1].first) {
    while (b.v[0].first < a.v[0].first) b.mv(0, 1);
    while (b.v.back().first > a.v[1].first)
      b.mv(b.v.size() - 1, b.v.size() - 2);
  }
  while (!op.empty()) {
    oa.emplace_back(op.back().second * 2 - op.back().first, op.back().second);
    op.pop_back();
  }
  printf("%d\n", (int)oa.size());
  for (auto &x : oa) printf("%lld %lld\n", x.first, x.second);
}