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