#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;
  }
}
