#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  int r1, r2, c1, c2, d1, d2;
  cin >> r1 >> r2;
  cout << endl;
  cin >> c1 >> c2;
  cout << endl;
  cin >> d1 >> d2;
  cout << endl;
  a = (r1 + c1 - d2) / 2;
  b = r1 - a;
  c = d2 - b;
  d = r2 - c;
  if (a == b || c == d || a == c || b == d) {
    cout << "-1";
  } else {
    cout << a << "  " << b << endl;
    cout << c << "  " << d;
  }
}
