#include <bits/stdc++.h>
using namespace std;
char M[500][500];
int n;
bool f1(int x[], int y[], int n) {
  int i, j, k, l;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) M[i][j] = 0;
  if (n < x[0] || n < y[0] || n < x[1] || n < y[1] || n < x[2] || n < y[2])
    return 0;
  for (i = 0; i < x[0]; i++)
    for (j = 0; j < y[0]; j++) M[i][j] = 'A';
  for (i = n - 1; i >= n - x[1]; i--)
    for (j = n - 1; j >= n - y[1]; j--)
      if (M[i][j])
        return 0;
      else
        M[i][j] = 'B';
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (!M[i][j] && i + x[2] - 1 <= n - 1 && j + y[2] - 1 &&
          !M[i + x[2] - 1][j + y[2] - 1]) {
        for (k = i; k <= n && k < i + x[2]; k++)
          for (l = j; l < j + y[2]; l++) M[k][l] = 'C';
        return 1;
      }
    }
  }
  return 0;
}
bool putem1(int x[], int y[]) {
  int i, j;
  int lo = 3, hi = max(x[0] + x[1] + x[2], y[0] + y[1] + y[2]), mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (f1(x, y, mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (f1(x, y, lo)) {
    for (i = 0; i < lo; i++)
      for (j = 0; j < lo; j++)
        if (!M[i][j]) return 0;
    n = lo;
    return 1;
  }
  return 0;
}
bool f2(int x[], int y[], int n) {
  int i, j, k, l;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) M[i][j] = 0;
  if (n < x[0] || n < y[0] || n < x[1] || n < y[1] || n < x[2] || n < y[2])
    return 0;
  for (i = 0; i < x[0]; i++)
    for (j = 0; j < y[0]; j++) M[i][j] = 'A';
  for (i = n - 1; i >= n - x[2]; i--)
    for (j = n - 1; j >= n - y[2]; j--)
      if (M[i][j])
        return 0;
      else
        M[i][j] = 'C';
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (!M[i][j] && i + x[1] - 1 <= n - 1 && j + y[1] - 1 &&
          !M[i + x[1] - 1][j + y[1] - 1]) {
        for (k = i; k <= n && k < i + x[1]; k++)
          for (l = j; l < j + y[1]; l++) M[k][l] = 'B';
        return 1;
      }
    }
  }
  return 0;
}
bool putem2(int x[], int y[]) {
  int i, j;
  int lo = 3, hi = max(x[0] + x[1] + x[2], y[0] + y[1] + y[2]), mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (f2(x, y, mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (f2(x, y, lo)) {
    for (i = 0; i < lo; i++)
      for (j = 0; j < lo; j++)
        if (!M[i][j]) return 0;
    n = lo;
    return 1;
  }
  return 0;
}
bool f3(int x[], int y[], int n) {
  int i, j, k, l;
  for (i = 0; i < n; i++)
    for (j = 0; j < n; j++) M[i][j] = 0;
  if (n < x[0] || n < y[0] || n < x[1] || n < y[1] || n < x[2] || n < y[2])
    return 0;
  for (i = 0; i < x[1]; i++)
    for (j = 0; j < y[1]; j++) M[i][j] = 'B';
  for (i = n - 1; i >= n - x[2]; i--)
    for (j = n - 1; j >= n - y[2]; j--)
      if (M[i][j])
        return 0;
      else
        M[i][j] = 'C';
  for (i = 0; i < n; i++) {
    for (j = 0; j < n; j++) {
      if (!M[i][j] && i + x[0] - 1 <= n - 1 && j + y[0] - 1 &&
          !M[i + x[0] - 1][j + y[0] - 1]) {
        for (k = i; k <= n && k < i + x[0]; k++)
          for (l = j; l < j + y[0]; l++) M[k][l] = 'A';
        return 1;
      }
    }
  }
  return 0;
}
bool putem3(int x[], int y[]) {
  int i, j;
  int lo = 3, hi = max(x[0] + x[1] + x[2], y[0] + y[1] + y[2]), mid;
  while (lo < hi) {
    mid = (lo + hi) / 2;
    if (f3(x, y, mid))
      hi = mid;
    else
      lo = mid + 1;
  }
  if (f3(x, y, lo)) {
    for (i = 0; i < lo; i++)
      for (j = 0; j < lo; j++)
        if (!M[i][j]) return 0;
    n = lo;
    return 1;
  }
  return 0;
}
int main(int argc, const char* argv[]) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int x1, x2, x3, y1, y2, y3, i, j;
  int x[4], y[4];
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  bool flag = 0;
  for (i = 0; i < 8; i++) {
    x[0] = x1;
    x[1] = x2;
    x[2] = x3;
    y[0] = y1;
    y[1] = y2;
    y[2] = y3;
    for (j = 0; j < 3; j++) {
      if (i & (1 << j)) swap(x[j], y[j]);
    }
    if (putem1(x, y)) {
      flag = 1;
      cout << n << "\n";
      for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) cout << M[i][j];
        cout << "\n";
      }
      break;
    } else if (putem2(x, y)) {
      flag = 1;
      cout << n << "\n";
      for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) cout << M[i][j];
        cout << "\n";
      }
      break;
    } else if (putem3(x, y)) {
      flag = 1;
      cout << n << "\n";
      for (i = 0; i < n; i++) {
        for (j = 0; j < n; j++) cout << M[i][j];
        cout << "\n";
      }
      break;
    }
  }
  if (flag == 0) cout << "-1";
  return 0;
}
