#include <bits/stdc++.h>
using namespace std;
int a[1000001], n, Max, f[1000001], t, k, b[100], t1, t2, d;
vector<pair<int, int> > vt;
vector<int> kk;
char ans[301][301];
char cal(int x) {
  if (x == 1) return 'A';
  if (x == 2) return 'B';
  if (x == 3) return 'C';
}
int main() {
  for (int i = 1; i <= 3; i++) scanf("%d %d", &a[i], &b[i]);
  for (int i = 1; i <= 3; i++) {
    Max = max(Max, a[i]);
    Max = max(Max, b[i]);
  }
  int dem = 0;
  for (int i = 1; i <= 3; i++) {
    if (a[i] == Max || b[i] == Max) {
      d = i;
      if (a[i] < b[i]) swap(a[i], b[i]);
      dem++;
    }
  }
  if (dem == 3) {
    int sum = 0;
    for (int i = 1; i <= 3; i++) {
      sum += b[i];
    }
    if (sum != Max) {
      puts("-1");
      return 0;
    }
    for (int i = 1; i <= b[1]; i++) {
      for (int j = 1; j <= Max; j++) ans[i][j] = 'A';
    }
    for (int i = b[1] + 1; i <= b[1] + b[2]; i++) {
      for (int j = 1; j <= Max; j++) ans[i][j] = 'B';
    }
    for (int i = b[1] + b[2] + 1; i <= b[1] + b[2] + b[3]; i++) {
      for (int j = 1; j <= Max; j++) ans[i][j] = 'C';
    }
    cout << Max << endl;
    for (int i = 1; i <= Max; i++) {
      for (int j = 1; j <= Max; j++) cout << ans[i][j];
      cout << endl;
    }
    return 0;
  }
  for (int i = 1; i <= 3; i++) {
    if (i != d) {
      vt.push_back(pair<int, int>(a[i], b[i]));
      kk.push_back(i);
    }
  }
  t = a[d] - b[d];
  if (vt[0].first == t)
    t1 = vt[0].second;
  else if (vt[0].second == t)
    t1 = vt[0].first;
  else {
    puts("-1");
    return 0;
  }
  if (vt[1].first == t)
    t2 = vt[1].second;
  else if (vt[1].second == t)
    t2 = vt[1].first;
  else {
    puts("-1");
    return 0;
  }
  if (t1 + t2 != Max) {
    puts("-1");
    return 0;
  }
  for (int i = 1; i <= b[d]; i++) {
    for (int j = 1; j <= Max; j++) ans[i][j] = cal(d);
  }
  for (int i = b[d] + 1; i <= Max; i++) {
    for (int j = 1; j <= t1; j++) ans[i][j] = cal(kk[0]);
  }
  for (int i = b[d] + 1; i <= Max; i++) {
    for (int j = t1 + 1; j <= Max; j++) ans[i][j] = cal(kk[1]);
  }
  cout << Max << endl;
  for (int i = 1; i <= Max; i++) {
    for (int j = 1; j <= Max; j++) cout << ans[i][j];
    cout << endl;
  }
  return 0;
}
