#include <bits/stdc++.h>
using namespace std;
int kr[2][3], sum = 0, st, a, b, tr[2], kv = 0;
int main() {
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 2; j++) {
      cin >> kr[j][i];
    }
    sum += kr[0][i] * kr[1][i];
  }
  bool ind = 1;
  for (int i = 0; i < 250; i++) {
    if (sum == i * i) {
      ind = 0;
      st = i;
    }
  }
  if (ind) {
    cout << -1;
    return 0;
  }
  for (int i = 0; i < 3; i++) {
    for (int j = 0; j < 2; j++) {
      if (kr[j][i] == st) {
        a = j;
        b = i;
        kv++;
      }
    }
  }
  if (kv == 3) {
    cout << st << endl;
    for (int i = 0; i < 3; i++) {
      for (int j = 0; j < 2; j++) {
        if (kr[j][i] != st) {
          for (int kl = 0; kl < kr[j][i]; kl++) {
            for (int er = 0; er < st; er++) {
              cout << char(i + 'A');
            }
            cout << endl;
          }
        }
      }
    }
    return 0;
  }
  int yh = 0;
  for (int i = 0; i < 3; i++) {
    if (i == b) {
      continue;
    }
    tr[yh] = i;
    yh++;
  }
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      if (kr[i][tr[0]] + kr[j][tr[1]] == kr[a][b]) {
        cout << st << endl;
        a = (a + 1) % 2;
        for (yh = 0; yh < kr[a][b]; yh++) {
          for (int fgh = 0; fgh < st; fgh++) {
            cout << char('A' + b);
          }
          cout << endl;
        }
        for (yh = kr[a][b]; yh < st; yh++) {
          for (int fgh = 0; fgh < kr[i][tr[0]]; fgh++) {
            cout << char('A' + tr[0]);
          }
          for (int fgh = kr[i][tr[0]]; fgh < st; fgh++) {
            cout << char('A' + tr[1]);
          }
          cout << endl;
        }
        return 0;
      }
    }
  }
  cout << -1;
}
