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