#include <bits/stdc++.h>
const double PI = acos(-1), EPS = 1e-7;
const int OO = 0x3f3f3f3f, N = 1e7 + 5, MOD = 1e9 + 7;
using namespace std;
void fast() {
  std::ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cout.tie(NULL);
}
int main() {
  fast();
  long long r1, r2, c1, c2, d1, d2;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  long long x = (c1 - d2 + r1) / 2;
  long long y = r1 - x;
  long long z = c1 - x;
  long long w = d1 - x;
  if (x <= 0 || y <= 0 || z <= 0 || w <= 0 || x == y || y == z || z == w ||
      x == z || y == w || x == w || x > 9 || y > 9 || z > 9 || w > 9)
    cout << -1 << "\n";
  else
    cout << x << " " << y << "\n" << z << " " << w << "\n";
  return 0;
}
