#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const int inf = 0x3f3f3f3f;
const long long linf = 0x3f3f3f3f3f3f3f3fLL;
struct A {
  int first, second, color;
  bool operator<(const A &rhs) const {
    if (first != rhs.first) return first < rhs.first;
    return second < rhs.second;
  }
} arr[3];
char grid[500][500];
bool try_line() {
  int w = arr[0].first + arr[1].first + arr[2].first;
  int h = arr[0].second;
  if (arr[1].second != h || arr[2].second != h) return false;
  if (w != h) return false;
  printf("%d\n", w);
  for (int i = (0); i < (h); ++i) {
    for (int j = (0); j < (3); ++j) {
      for (int k = (0); k < (arr[j].first); ++k) putchar(arr[j].color + 'A');
    }
    puts("");
  }
  return true;
}
bool try_t() {
  int w1 = arr[0].first + arr[1].first;
  int w2 = arr[2].first;
  if (w1 != w2) return false;
  if (arr[0].second != arr[1].second) return false;
  if (arr[0].second + arr[2].second != w1) return false;
  printf("%d\n", w1);
  for (int i = (0); i < (arr[0].second); ++i) {
    for (int j = (0); j < (2); ++j) {
      for (int k = (0); k < (arr[j].first); ++k) putchar(arr[j].color + 'A');
    }
    puts("");
  }
  for (int i = (0); i < (arr[2].second); ++i) {
    for (int j = (0); j < (w1); ++j) putchar(arr[2].color + 'A');
    puts("");
  }
  return true;
}
bool try_f() {
  int h = arr[0].second;
  if (h != arr[1].second + arr[2].second) return false;
  if (arr[1].first != arr[2].first) return false;
  if (arr[0].first + arr[1].first != h) return false;
  printf("%d\n", h);
  for (int i = (0); i < (2); ++i) {
    for (int j = (0); j < (arr[i + 1].second); ++j) {
      for (int _ = (0); _ < (arr[0].first); ++_) putchar(arr[0].color + 'A');
      for (int _ = (0); _ < (arr[i + 1].first); ++_)
        putchar(arr[i + 1].color + 'A');
      puts("");
    }
  }
  return true;
}
int main() {
  for (int i = (0); i < (3); ++i)
    scanf("%d %d", &arr[i].first, &arr[i].second), arr[i].color = i;
  sort(arr, arr + 3);
  do {
    for (int _ = (0); _ < (2); ++_) {
      for (int __ = (0); __ < (2); ++__) {
        for (int ___ = (0); ___ < (2); ++___) {
          if (try_line()) return 0;
          if (try_t()) return 0;
          if (try_f()) return 0;
          swap(arr[2].first, arr[2].second);
        }
        swap(arr[1].first, arr[1].second);
      }
      swap(arr[0].first, arr[0].second);
    }
  } while (next_permutation(arr, arr + 3));
  puts("-1");
  return 0;
}
