#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  long long int r1, r2, c1, c2, d1, d2;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  long long int a11 = (r1 + c1 - d2) / 2;
  long long int a12 = r1 - a11;
  long long int a21 = c1 - a11;
  long long int a22 = r2 - a21;
  set<int> s;
  vector<int> v;
  s.insert(a11), s.insert(a12), s.insert(a21), s.insert(a22);
  v.push_back(a11), v.push_back(a12), v.push_back(a21), v.push_back(a22);
  if (s.size() == 4 && v[0] >= 1 && v[3] <= 9) {
    cout << a11 << " " << a12 << endl;
    cout << a21 << " " << a22 << endl;
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
