#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int r1, r2, d1, d2, c1, c2, w, x, y, z;
  cin >> r1 >> r2;
  cin >> c1 >> c2;
  cin >> d1 >> d2;
  set<int> s;
  w = (r1 + d1 - c2) / 2;
  x = (r1 + c2 - d1) / 2;
  y = (2 * c1 + c2 - d1 - r1) / 2;
  z = (d1 + c2 - r1) / 2;
  s.insert(w);
  s.insert(y);
  s.insert(x);
  s.insert(z);
  if ((s.size() == 4) and (w + x == r1 and y + z == r2 and w + y == c1 and
                           x + z == c2 and w + z == d1 and x + y == d2)) {
    cout << w << " " << x << "\n";
    cout << y << " " << z << "\n";
  } else {
    cout << -1 << "\n";
  }
  return 0;
}
