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