#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  int r1, r2, c1, c2, d1, d2;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  int a[2][2] = {{0, 0}, {0, 0}};
  a[1][0] = min(r2 - 1, c1 - 1);
  a[0][0] = c1 - a[1][0];
  a[1][1] = r2 - a[1][0];
  a[0][1] = r1 - a[0][0];
  if (a[0][0] + a[1][0] == c1 && a[0][0] + a[0][1] == r1 &&
      a[1][0] + a[1][1] == r2 && a[0][1] + a[1][1] == c2 &&
      a[0][0] + a[1][1] == d1 && a[0][1] + a[1][0] == d2) {
    for (int i = 0; i < (int)(2); i++) {
      for (int j = 0; j < (int)(2); j++) {
        cout << a[i][j] << " ";
      }
      cout << endl;
    }
  } else {
    cout << -1 << endl;
  }
  cerr << "Time: " << 1.0 * clock() / CLOCKS_PER_SEC << "s.\n";
  return 0;
}
