#include <bits/stdc++.h>
using namespace std;
void Open() {}
double slope(pair<long long, long long> x, pair<long long, long long> y) {
  return (x.second - y.second) / (x.first - y.first);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int r1, r2, c1, c2, d1, d2, w, x, y, z;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  x = (r1 + d2 - c1) / 2;
  y = d2 - x;
  w = c1 - y;
  z = c2 - x;
  if (w + x != r1 || y + z != r2 || w + y != c1 || x + z != c2 || w + z != d1 ||
      x + y != d2 || x == y || x == w || x == z || y == z || y == w || w == z)
    cout << -1;
  else
    cout << w << ' ' << x << '\n' << y << ' ' << z;
  return 0;
}
