#include <bits/stdc++.h>
using namespace std;
int main() {
  int r1, r2, c1, c2, d1, d2, s1, s2, s3, s4;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  s2 = (r1 + d2 - c1) / 2;
  s1 = r1 - s2;
  s3 = d2 - s2;
  s4 = d1 - s1;
  if (s1 == -1 || s2 == -1 || s3 == -1 || s4 == -1 ||
      (s4 == s1 && s1 == s3 && s1 == s2)) {
    cout << "-1";
    return 0;
  }
  cout << s1 << " " << s2 << endl;
  cout << s3 << " " << s4;
  return 0;
}
