#include <bits/stdc++.h>
using namespace std;
pair<int, int> p[4];
int ans, x, y;
char c[555][555], ch[4];
bool flag;
int main() {
  cin >> p[1].first >> p[1].second >> p[2].first >> p[2].second >> p[3].first >>
      p[3].second;
  ch[1] = 'A';
  ch[2] = 'B';
  ch[3] = 'C';
  for (int i = 1; i <= 3; i++)
    for (int j = i + 1; j <= 3; j++) {
      if (flag) break;
      int k = 6 - i - j;
      if (p[i].first == p[j].first) {
        x = p[i].second + p[j].second;
        y = p[i].first;
        if (x == p[k].first) {
          if (x == y + p[k].second) {
            ans = x;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= p[k].first; h++)
                c[z][h] = ch[j];
            for (int z = p[i].first + 1; z <= p[i].first + p[k].second; z++)
              for (int h = 1; h <= p[k].first; h++) c[z][h] = ch[k];
            flag = true;
            break;
          }
        }
        if (x == p[k].second) {
          if (x == y + p[k].first) {
            ans = x;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= p[k].second; h++)
                c[z][h] = ch[j];
            for (int z = p[i].first + 1; z <= p[i].first + p[k].first; z++)
              for (int h = 1; h <= p[k].second; h++) c[z][h] = ch[k];
            flag = true;
            break;
          }
        }
        if (y == p[k].first) {
          if (x + p[k].second == y) {
            flag = true;
            ans = y;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= x; h++) c[z][h] = ch[j];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = x + 1; h <= x + p[k].second; h++) c[z][h] = ch[k];
            break;
          }
        }
        if (y == p[k].second) {
          if (x + p[k].first == y) {
            flag = true;
            ans = y;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= x; h++) c[z][h] = ch[j];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = x + 1; h <= x + p[k].first; h++) c[z][h] = ch[k];
            break;
          }
        }
      }
      if (p[i].first == p[j].second) {
        x = p[i].second + p[j].first;
        y = p[i].first;
        if (x == p[k].first) {
          if (x == y + p[k].second) {
            ans = x;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= x; h++) c[z][h] = ch[j];
            for (int z = p[i].first + 1; z <= p[i].first + p[k].second; z++)
              for (int h = 1; h <= x; h++) c[z][h] = ch[k];
            flag = true;
            break;
          }
        }
        if (x == p[k].second) {
          if (x == y + p[k].first) {
            ans = x;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= x; h++) c[z][h] = ch[j];
            for (int z = p[i].first + 1; z <= p[i].first + p[k].first; z++)
              for (int h = 1; h <= p[k].second; h++) c[z][h] = ch[k];
            flag = true;
            break;
          }
        }
        if (y == p[k].first) {
          if (x + p[k].second == y) {
            flag = true;
            ans = y;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= x; h++) c[z][h] = ch[j];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = x + 1; h <= x + p[k].second; h++) c[z][h] = ch[k];
            break;
          }
        }
        if (y == p[k].second) {
          if (x + p[k].first == y) {
            flag = true;
            ans = y;
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = p[i].second + 1; h <= x; h++) c[z][h] = ch[j];
            for (int z = 1; z <= p[i].first; z++)
              for (int h = x + 1; h <= x + p[k].first; h++) c[z][h] = ch[k];
            break;
          }
        }
      }
      if (p[i].second == p[j].first) {
        x = p[i].first + p[j].second;
        y = p[i].second;
        if (x == p[k].first) {
          if (x == y + p[k].second) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = 1; z <= x; z++)
              for (int h = y + 1; h <= p[k].second + y; h++) c[z][h] = ch[k];
            flag = true;
            ans = x;
            break;
          }
        }
        if (x == p[k].second) {
          if (x == y + p[k].first) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = 1; z <= x; z++)
              for (int h = y + 1; h <= p[k].first + y; h++) c[z][h] = ch[k];
            flag = true;
            ans = x;
            break;
          }
        }
        if (y == p[k].first) {
          if (y == p[k].second + x) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = x + 1; z <= x + p[k].second; z++)
              for (int h = 1; h <= y; h++) c[z][h] = ch[k];
            flag = true;
            ans = y;
            break;
          }
        }
        if (y == p[k].second) {
          if (y == x + p[k].first) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = x + 1; z <= x + p[k].first; z++)
              for (int h = 1; h <= y; h++) c[z][h] = ch[k];
            flag = true;
            ans = y;
            break;
          }
        }
      }
      if (p[i].second == p[j].second) {
        x = p[i].first + p[j].first;
        y = p[i].second;
        if (x == p[k].first) {
          if (x == y + p[k].second) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = 1; z <= x; z++)
              for (int h = y + 1; h <= p[k].second + y; h++) c[z][h] = ch[k];
            flag = true;
            ans = x;
            break;
          }
        }
        if (x == p[k].second) {
          if (x == y + p[k].first) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = 1; z <= x; z++)
              for (int h = y + 1; h <= p[k].first + y; h++) c[z][h] = ch[k];
            flag = true;
            ans = x;
            break;
          }
        }
        if (y == p[k].first) {
          if (y == p[k].second + x) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = x + 1; z <= x + p[k].second; z++)
              for (int h = 1; h <= y; h++) c[z][h] = ch[k];
            ans = y;
            flag = true;
            break;
          }
        }
        if (y == p[k].second) {
          if (y == x + p[k].first) {
            for (int z = 1; z <= p[i].first; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[i];
            for (int z = p[i].first + 1; z <= x; z++)
              for (int h = 1; h <= p[i].second; h++) c[z][h] = ch[j];
            for (int z = x + 1; z <= x + p[k].first; z++)
              for (int h = 1; h <= y; h++) c[z][h] = ch[k];
            ans = y;
            flag = true;
            break;
          }
        }
      }
    }
  if (flag) {
    cout << ans << endl;
    for (int i = 1; i <= ans; i++) {
      for (int j = 1; j <= ans; j++) cout << c[i][j];
      cout << endl;
    }
  } else
    cout << -1;
  return 0;
}
