#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[]) {
  int r1, r2, c1, c2, d1, d2;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  int min3 = min(r1, c1);
  min3 = min(min3, d1);
  for (int i = 1; i < min3; i++) {
    int b1, b2, b3, b4;
    b1 = i;
    b2 = r1 - i;
    b3 = c1 - i;
    b4 = d1 - i;
    if ((b3 + b4) != r2 || (b2 + b4) != c2 || (b2 + b3) != d2 ||
        (b1 + b4) != d1 || (b1 + b2) != r1 || (b1 + b3) != c1)
      continue;
    if (b1 != b2 && b2 != b3 && b3 != b4) {
      cout << b1 << " " << b2 << endl;
      cout << b3 << " " << b4 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
