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