#include <bits/stdc++.h>
using namespace std;
const int SIZE = 1e+5 + 10;
const long long INF = 1 << 30;
const long double eps = 1e-6;
const long long mod = 1e+9 + 7;
char c[] = {'A', 'B', 'C'};
int x[3][2], y[3][2];
vector<pair<long long, long long> > vec;
void search(int n) {
  if (n >= 3) {
    int nx[3], ny[3], xmax = 0, ymax = 0;
    bool check[3] = {0};
    for (int i = (0); i < (3); i++) {
      nx[i] = vec[i].first;
      ny[i] = vec[i].second;
      xmax = max(xmax, nx[i]);
      ymax = max(ymax, ny[i]);
    }
    int pm = max(xmax, ymax), m, k;
    for (int i = (0); i < (3); i++) {
      if (pm == nx[i]) {
        m = i;
        break;
      } else if (pm == ny[i]) {
        m = i;
        break;
      }
    }
    if (m == 0)
      k = 1;
    else
      k = 0;
    int sx = 0, sy = 0, xp = 0, yp = 0;
    for (int i = (0); i < (3); i++) {
      if (i == m) continue;
      sx += nx[i];
      sy += ny[i];
      if (!xp) {
        xp = nx[i];
        yp = ny[i];
      } else {
        xp = xp == nx[i];
        yp = yp == ny[i];
      }
    }
    if (!((sx == pm && yp && ny[k] + ny[m] == pm) ||
          (nx[0] == nx[1] && nx[1] == nx[2] && sy + ny[m] == pm))) {
      return;
    }
    printf("%d\n", pm);
    for (int i = (0); i < (ny[m]); i++) {
      for (int i = (0); i < (nx[m]); i++) {
        printf("%c", c[m]);
      }
      printf("\n");
    }
    int nl;
    for (int i = (0); i < (3); i++) {
      if (i == m) continue;
      int n;
      if (i + 1 == m)
        n = i + 2;
      else
        n = i + 1;
      bool f = false;
      if (pm == nx[i]) f = true;
      if (!f) {
        for (int j = (0); j < (ny[i]); j++) {
          for (int l = (0); l < (nx[i]); l++) {
            printf("%c", c[i]);
          }
          for (int l = (0); l < (nx[n]); l++) {
            printf("%c", c[n]);
          }
          printf("\n");
        }
      } else {
        for (int j = (0); j < (ny[i]); j++) {
          for (int l = (0); l < (nx[i]); l++) {
            printf("%c", c[i]);
          }
          printf("\n");
        }
        for (int j = (0); j < (ny[n]); j++) {
          for (int l = (0); l < (nx[n]); l++) {
            printf("%c", c[n]);
          }
          printf("\n");
        }
      }
      break;
    }
    exit(0);
  }
  vec.push_back(pair<long long, long long>(x[n][0], y[n][0]));
  search(n + 1);
  vec.pop_back();
  vec.push_back(pair<long long, long long>(x[n][1], y[n][1]));
  search(n + 1);
  vec.pop_back();
}
int main() {
  for (int i = (0); i < (3); i++) {
    cin >> x[i][0] >> y[i][0];
    x[i][1] = y[i][0];
    y[i][1] = x[i][0];
  }
  search(0);
  cout << "-1" << endl;
  return 0;
}
