#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<ll>;
using vpii = vector<pair<ll, ll>>;
vpii r;
inline void sort(vi &a) { sort(a.begin(), a.end()); }
void rev(vpii &a) {
  reverse(a.begin(), a.end());
  for (auto &i : a) i.first = i.second * 2 - i.first;
}
void move(int x, int y, vi &a, vpii &b) {
  if (a[x] == a[y]) return;
  b.push_back({a[x], a[y]});
  a[x] = a[y] * 2 - a[x];
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
vpii m1(vi &a) {
  vpii v;
  ll g = gcd(a[3] - a[0], gcd(a[3] - a[1], a[3] - a[2]));
  while (a[3] - a[0] > g) {
    ll d = a[3] - a[0], x = min(a[3] - a[1], a[1] - a[0]),
       y = min(a[3] - a[2], a[2] - a[0]);
    if (x >= max(1ll, d / 4)) {
      if (x == a[3] - a[1])
        move(3, 1, a, v), move(2, 1, a, v);
      else
        move(0, 1, a, v);
    } else if (y >= max(1ll, d / 4)) {
      if (y == a[3] - a[2])
        move(3, 2, a, v);
      else
        move(1, 2, a, v), move(0, 2, a, v);
    } else {
      if (x < y) {
        if (y == a[3] - a[2])
          move(1, 2, a, v), move(1, 3, a, v);
        else
          move(1, 0, a, v), move(1, 2, a, v);
      } else {
        if (x == a[1] - a[0])
          move(2, 1, a, v), move(2, 0, a, v);
        else
          move(2, 3, a, v), move(2, 1, a, v);
      }
    }
    sort(a);
  }
  return v;
}
void m2(vi &a, ll d, vpii &v) {
  ll g = a[3] - a[0];
  if ((a[0] / g) % 2 != (d / g) % 2) {
    move(0, 3, a, v);
    move(1, 3, a, v);
    move(2, 3, a, v);
    sort(a);
  }
  ll va = (d - a[0]) / 2;
  while (a[3] - a[0] <= va) {
    move(2, 0, a, v);
    move(1, 3, a, v);
    sort(a);
  }
  while (a[3] - a[0] > g) {
    move(0, 1, a, v);
    move(3, 2, a, v);
    sort(a);
    while (a[3] - a[0] <= va) {
      move(0, 3, a, v);
      move(1, 3, a, v);
      move(2, 3, a, v);
      sort(a);
      move(0, 3, a, v);
      move(1, 3, a, v);
      move(2, 3, a, v);
      sort(a);
      va -= a[3] - a[0];
    }
  }
}
int main() {
  ios::sync_with_stdio(false);
  vi a(4), b(4);
  for (auto &i : a) cin >> i;
  for (auto &i : b) cin >> i;
  sort(a);
  sort(b);
  if (a[0] == a[3]) {
    if (b == a)
      cout << 0 << endl;
    else
      cout << -1 << endl;
    return 0;
  }
  auto c = m1(a), d = m1(b);
  ll g = a[3] - a[0];
  if (b[3] - b[0] != g || b[0] % g != a[0] % g) {
    cout << -1 << endl;
    return 0;
  }
  if (a[0] < b[0])
    m2(a, b[0], c);
  else
    m2(b, a[0], d);
  if (a != b) {
    cout << -1 << endl;
    return 0;
  }
  rev(d);
  c.insert(c.end(), d.begin(), d.end());
  cout << c.size() << endl;
  for (auto &i : c) cout << i.first << ' ' << i.second << endl;
  return 0;
}
