#include <bits/stdc++.h>
using namespace std;
struct Rect {
  int x, y;
};
int dif(int i, int j) {
  int x = 2;
  if (i == 2 || j == 2)
    x--;
  else
    return x;
  if (i == 1 || j == 1)
    x--;
  else
    return x;
  return x;
}
int main() {
  Rect R[3];
  for (int i = 0; i < 3; i++) scanf("%d", &R[i].x), scanf("%d", &R[i].y);
  Rect U;
  bool salir = 0;
  int x1, x2, y;
  int c1, c2;
  for (int i = 0; i < 2; i++) {
    c1 = i;
    for (int j = i + 1; j < 3; j++) {
      c2 = j;
      for (int i2 = 0; i2 < 2; i2++) {
        swap(R[i].x, R[i].y);
        for (int j2 = 0; j2 < 2; j2++) {
          swap(R[j].x, R[j].y);
          if (R[i].y == R[j].y) {
            U.y = R[i].y;
            U.x = R[i].x + R[j].x;
            x1 = R[i].x;
            x2 = R[j].x;
            y = R[i].y;
            int k = dif(i, j);
            for (int k2 = 0; k2 < 2; k2++) {
              swap(U.x, U.y);
              for (int z2 = 0; z2 < 2; z2++) {
                swap(R[k].x, R[k].y);
                if ((U.y == R[k].y) && (U.x + R[k].x == U.y)) {
                  salir = 1;
                  break;
                }
              }
              if (salir) break;
            }
          }
          if (salir) break;
        }
        if (salir) break;
      }
      if (salir) break;
    }
    if (salir) break;
  }
  if (!salir)
    cout << -1 << '\n';
  else {
    int y2 = max(y, x1 + x2);
    cout << y2 << endl;
    if (y2 == x1 + x2) {
      int c3 = dif(c1, c2);
      for (int j = 0; j < y2 - y; j++) {
        for (int i = 0; i < y2; i++) {
          if (c3 == 0) cout << 'A';
          if (c3 == 1) cout << 'B';
          if (c3 == 2) cout << 'C';
        }
        cout << endl;
      }
      for (int j = 0; j < y; j++) {
        for (int i = 0; i < y2; i++) {
          if (i < x1) {
            if (c1 == 0) cout << 'A';
            if (c1 == 1) cout << 'B';
            if (c1 == 2) cout << 'C';
          } else {
            if (c2 == 0) cout << 'A';
            if (c2 == 1) cout << 'B';
            if (c2 == 2) cout << 'C';
          }
        }
        cout << endl;
      }
    } else {
      for (int j = 0; j < x1; j++) {
        for (int i = 0; i < y2; i++) {
          if (c1 == 0) cout << 'A';
          if (c1 == 1) cout << 'B';
          if (c1 == 2) cout << 'C';
        }
        cout << endl;
      }
      for (int j = 0; j < x2; j++) {
        for (int i = 0; i < y2; i++) {
          if (c2 == 0) cout << 'A';
          if (c2 == 1) cout << 'B';
          if (c2 == 2) cout << 'C';
        }
        cout << endl;
      }
      int c3 = dif(c1, c2);
      for (int j = 0; j < y2 - x1 - x2; j++) {
        for (int i = 0; i < y2; i++) {
          if (c3 == 0) cout << 'A';
          if (c3 == 1) cout << 'B';
          if (c3 == 2) cout << 'C';
        }
        cout << endl;
      }
    }
  }
  return 0;
}
