#include <bits/stdc++.h>
using namespace std;
using namespace chrono;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
const long long MOD = 1000000007;
const long long inf = 1e18;
const long long MOD_1 = 998244353;
inline long long gcd(long long a, long long b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
inline void take_input(long long A[], long long n) {
  for (long long i = 0; i < n; i++) {
    cin >> A[i];
  }
}
inline void show(long long *A, long long n) {
  for (long long i = 0; i < n; i++) {
    cout << A[i] << " ";
  }
  cout << '\n';
}
inline long long countDivisibles(long long a, long long b, long long c) {
  if (a % c == 0) {
    return (b / c - a / c + 1);
  }
  return (b / c - a / c);
}
inline bool sortbysec(const pair<long long, long long> &a,
                      const pair<long long, long long> &b) {
  return (a.second < b.second);
}
inline bool sortbysecdesc(const pair<long long, long long> &a,
                          const pair<long long, long long> &b) {
  return (a.second > b.second);
}
inline void swap(long long &a, long long &b) {
  long long temp = a;
  a = b;
  b = temp;
}
inline void initialise(long long A[], long long n, long long k = 0) {
  for (long long i = 0; i < n; i++) {
    A[i] = k;
  }
}
inline long long modulo(long long a, long long b) { return (b + (a % b)) % b; }
inline long long getascii(char ch) { return (long long)ch; }
inline long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); }
template <typename T>
void show_vect(vector<T> v) {
  for (long long i = 0; i < v.size(); i++) {
    cout << v[i] << " ";
  }
  cout << '\n';
}
template <typename T>
void debug_vect(vector<T> v) {
  for (long long i = 0; i < v.size(); i++) {
    cerr << v[i] << " ";
  }
  cerr << '\n';
}
template <typename T>
void vect_input(vector<T> &v, T n) {
  for (long long i = 0; i < n; i++) {
    cin >> v[i];
  }
}
template <typename T>
void show_set(set<T> s) {
  for (auto x : s) {
    cout << x << " ";
  }
  cout << '\n';
}
const long long rownbr[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
const long long colnbr[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
void p_g_t() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
}
void solve() {
  long long r1, r2, c1, c2, d1, d2;
  cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2;
  {
    long long a2 = ((d2 - r2) + c2) / 2;
    long long a3 = d2 - a2;
    long long a1 = r1 - a2;
    long long a4 = d1 - a1;
    set<long long> s;
    s.insert(a1);
    s.insert(a2);
    s.insert(a3);
    s.insert(a4);
    if (a1 < 0 || a2 < 0 || a3 < 0 || a4 < 0 || s.size() < 4)
      cout << -1;
    else
      cout << a1 << " " << a2 << '\n' << a3 << " " << a4;
  }
}
int32_t main() {
  p_g_t();
  long long t = 1;
  while (t--) {
    solve();
  }
  cerr << "Time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl;
  return 0;
}
