#include <bits/stdc++.h>
using namespace std;
int n;
int x[10], y[10];
int mat[1005][1005];
bool panduan(int m, int a, int b) {
  if (x[a] != n) swap(x[a], y[a]);
  if (x[a] == n) {
    if (x[b] != n) swap(x[b], y[b]);
    if (x[b] == n) {
      for (int i = 1; i <= y[a]; ++i)
        for (int j = 1; j <= n; ++j) mat[i][j] = a;
      for (int i = 1; i <= y[b]; ++i)
        for (int j = 1; j <= n; ++j) mat[i + y[a]][j] = b;
      return 1;
    }
  }
  if (x[a] != m) swap(x[a], y[a]);
  if (x[a] == m) {
    if (x[b] != m) swap(x[b], y[b]);
    if (x[b] == m) {
      for (int i = 1; i <= m; ++i)
        for (int j = 1; j <= y[a]; ++j) mat[i][j] = a;
      for (int i = 1; i <= m; ++i)
        for (int j = 1; j <= y[b]; ++j) mat[i][j + y[a]] = b;
      return 1;
    }
  }
  return 0;
}
int main() {
  scanf("%d%d%d%d%d%d", &x[1], &y[1], &x[2], &y[2], &x[3], &y[3]);
  int sum = x[1] * y[1] + x[2] * y[2] + x[3] * y[3];
  n = sqrt(sum + 0.01);
  if (n * n != sum) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= 3; ++i) {
    if (x[i] > n || y[i] > n) {
      puts("-1");
      return 0;
    }
  }
  for (int i = 1, j, k; i <= 3; ++i) {
    if (i == 1)
      j = 2, k = 3;
    else if (i == 2)
      j = 1, k = 3;
    else if (i == 3)
      j = 1, k = 2;
    if (x[i] != n) swap(x[i], y[i]);
    if (x[i] == n) {
      if (panduan(n - y[i], j, k)) {
        for (int ii = n - y[i] + 1; ii <= n; ++ii)
          for (int jj = 1; jj <= n; ++jj) mat[ii][jj] = i;
        printf("%d\n", n);
        for (int ii = 1; ii <= n; ++ii) {
          for (int jj = 1; jj <= n; ++jj) printf("%c", 64 + mat[ii][jj]);
          puts("");
        }
        return 0;
      }
    }
  }
  puts("-1");
  return 0;
}
