#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[6], x, y, z, k;
  for (int i = 0; i < 6; i++) scanf("%d", a + i);
  for (int i = 0; i < 8; i++) {
    x = i + 1;
    y = a[0] - x;
    z = a[2] - x;
    k = a[3] - y;
    if (x != y && y != z && z != k && (x + k == a[4] && y + z == a[5])) {
      printf("%d %d\n%d %d\n", x, y, z, k);
      return 0;
    }
  }
  printf("%d\n", -1);
}
