#include <bits/stdc++.h>
using namespace std;
int x[21];
int main() {
  int a, b, c, d, r1, r2, c1, c2, d1, d2, i;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  if (2 * (d1 + d2) != (r1 + r2 + c1 + c2))
    cout << "-1", exit(0);
  else {
    a = (c1 + r1 - d2) / 2;
    b = c2 + d2 - r2, b = b / 2;
    c = c1 - a;
    d = c2 - b;
    x[a]++;
    x[b]++;
    x[c]++;
    x[d]++;
    for (i = 0; i <= 20; i++) {
      if (x[i] > 1) cout << "-1", exit(0);
    }
    {
      cout << a << " " << b << "\n";
      cout << c << " " << d;
    }
  }
  return 0;
}
