#include <bits/stdc++.h>
using namespace std;
const int Mod = 1000000007;
const int N = 4000;
char grid[200][200];
int main() {
  for (int i = 0; i < 200; ++i) {
    for (int j = 0; j < 200; ++j) {
      grid[i][j] = '.';
    }
  }
  int a[3], b[3], ms = 0, area = 0;
  for (int i = 0; i < 3; ++i) {
    scanf("%d %d", a + i, b + i);
    ms = max(a[i], ms);
    ms = max(b[i], ms);
    area += (a[i] * b[i]);
  }
  int root = sqrt(area);
  if (root * root != area || root > ms) {
    puts("-1");
    return 0;
  }
  if (a[0] < b[0]) swap(a[0], b[0]);
  for (int i = 0; i < a[0]; ++i) {
    for (int j = 0; j < b[0]; ++j) {
      grid[i][j] = 'A';
    }
  }
  int gap[2];
  gap[0] = root - b[0];
  gap[1] = root - a[0];
  if (max(a[0], b[0]) != root) {
    bool flip = false;
  A:
    if ((a[1] == gap[1] && b[1] == root) || (b[1] == gap[1] && a[1] == root)) {
      for (int i = a[0]; i < root; ++i) {
        for (int j = 0; j < root; ++j) {
          grid[i][j] = (!flip) ? 'B' : 'C';
        }
      }
      if ((a[2] == gap[0] && b[2] == a[0]) ||
          (a[2] == a[0] && b[2] == gap[0])) {
        cout << root << "\n";
        for (int i = 0; i < root; ++i) {
          for (int j = 0; j < root; ++j) {
            if (grid[i][j] == '.' && !flip)
              cout << 'C';
            else if (grid[i][j] == '.' && flip)
              cout << 'B';
            else
              cout << grid[i][j];
          }
          cout << "\n";
        }
      } else {
        printf("-1");
        return 0;
      }
    } else if ((a[1] == gap[1] && b[1] == b[0]) ||
               (b[1] == gap[1] && a[1] == b[0])) {
      for (int i = a[0]; i < root; ++i) {
        for (int j = 0; j < b[0]; ++j) {
          grid[i][j] = (!flip) ? 'B' : 'C';
        }
      }
      if ((a[2] == gap[0] && b[2] == root) ||
          (a[2] == root && b[2] == gap[0])) {
        cout << root << "\n";
        for (int i = 0; i < root; ++i) {
          for (int j = 0; j < root; ++j) {
            if (grid[i][j] == '.' && !flip)
              cout << 'C';
            else if (grid[i][j] == '.' && flip)
              cout << 'B';
            else
              cout << grid[i][j];
          }
          cout << "\n";
        }
      } else {
        printf("-1");
        return 0;
      }
    } else {
      if (flip) {
        printf("-1");
        return 0;
      }
      flip = true;
      swap(a[1], a[2]);
      swap(b[1], b[2]);
      goto A;
    }
  } else {
    int exact = max(gap[0], gap[1]);
    if (max(a[1], b[1]) != root || max(a[2], b[2]) != root) {
      int x = a[1], y = a[2];
      if (a[1] == exact) x = b[1];
      if (a[2] == exact) y = b[2];
      if (x + y == root && (a[1] == exact || b[1] == exact) &&
          (b[2] == exact || a[2] == exact)) {
        for (int i = 0; i < x; ++i) {
          for (int j = b[0]; j < root; ++j) {
            grid[i][j] = 'B';
          }
        }
        for (int i = x; i < root; ++i) {
          for (int j = b[0]; j < root; ++j) {
            grid[i][j] = 'C';
          }
        }
        cout << root << "\n";
        for (int i = 0; i < root; ++i) {
          for (int j = 0; j < root; ++j) {
            cout << grid[i][j];
          }
          cout << "\n";
        }
      } else
        printf("-1");
      return 0;
    } else {
      int cols[3];
      for (int i = 0; i < 3; ++i) cols[i] = min(a[i], b[i]);
      cols[1] += cols[0];
      cols[2] += cols[1];
      char ch = 'C';
      for (int i = 2; i >= 0; --i) {
        for (int l = 0; l < cols[i]; ++l) {
          for (int j = 0; j < root; ++j) {
            grid[l][j] = ch;
          }
        }
        --ch;
      }
      cout << root << "\n";
      for (int i = 0; i < root; ++i) {
        for (int j = 0; j < root; ++j) {
          cout << grid[i][j];
        }
        cout << "\n";
      }
    }
  }
  return 0;
}
