#include <bits/stdc++.h>
using namespace std;
int main() {
  int r1, r2, c1, c2, d1, d2;
  while (cin >> r1 >> r2 >> c1 >> c2 >> d1 >> d2) {
    int x, y, z, a;
    for (x = 1; x != 10; x++) {
      cout << x << "x" << endl;
      y = r1 - x;
      z = c1 - x;
      a = r2 - z;
      if (y >= 1 && y <= 9 && z >= 1 && z <= 9 && a >= 1 && a <= 9 &&
          y + a == c2 && x + a == d1 && y + z == d2 && a != x && y != z &&
          y != a) {
        cout << x << " " << y << endl;
        cout << z << " " << a << endl;
        break;
      }
    }
    if (x == 10) cout << "-1" << endl;
  }
  return 0;
}
