#include <bits/stdc++.h>
using namespace std;
void print_line(int a, int b, int c) {
  int n = a + b + c;
  cout << n << endl;
  for (int i = 0; i < a; ++i) {
    for (int j = 0; j < n; ++j) cout << 'A';
    cout << endl;
  }
  for (int i = 0; i < b; ++i) {
    for (int j = 0; j < n; ++j) cout << 'B';
    cout << endl;
  }
  for (int i = 0; i < c; ++i) {
    for (int j = 0; j < n; ++j) cout << 'C';
    cout << endl;
  }
}
bool in_line(int x1, int y1, int x2, int y2, int x3, int y3) {
  if (x1 == x2 || x1 == y2) {
    if (x1 == y2) swap(x2, y2);
    if (x1 == x3 || x1 == y3) {
      if (x1 == y3) swap(x3, y3);
      if (x1 == y1 + y2 + y3) {
        print_line(y1, y2, y3);
        return true;
      }
    }
  }
  swap(x1, y1);
  if (x1 == x2 || x1 == y2) {
    if (x1 == y2) swap(x2, y2);
    if (x1 == x3 || x1 == y3) {
      if (x1 == y3) swap(x3, y3);
      if (x1 == y1 + y2 + y3) {
        print_line(y1, y2, y3);
        return true;
      }
    }
  }
  return false;
}
void print_two(int x1, int x2, int y2, char a, char b, char c) {
  int n = x1 + x2;
  cout << n << endl;
  for (int i = 0; i < x1; ++i) {
    for (int j = 0; j < n; ++j) cout << a;
    cout << endl;
  }
  for (int i = 0; i < x2; ++i) {
    for (int j = 0; j < n; ++j) cout << (j < y2 ? b : c);
    cout << endl;
  }
}
bool two_top(int x1, int y1, int x2, int y2, int x3, int y3, char a, char b,
             char c) {
  if (x2 == x3 || x2 == y3) {
    if (x2 == y3) swap(x3, y3);
    int w = y2 + y3;
    if (w == x1 || w == y1) {
      if (w == x1) swap(x1, y1);
      if (w == x1 + x2) {
        print_two(x1, x2, y2, a, b, c);
        return true;
      }
    }
  }
  swap(x2, y2);
  if (x2 == x3 || x2 == y3) {
    if (x2 == y3) swap(x3, y3);
    int w = y2 + y3;
    if (w == x1 || w == y1) {
      if (w == x1) swap(x1, y1);
      if (w == x1 + x2) {
        print_two(x1, x2, y2, a, b, c);
        return true;
      }
    }
  }
  return false;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  bool b = in_line(x1, y1, x2, y2, x3, y3) ||
           two_top(x1, y1, x2, y2, x3, y3, 'A', 'B', 'C') ||
           two_top(x3, y3, x2, y2, x1, y1, 'C', 'B', 'A') ||
           two_top(x2, y2, x1, y1, x3, y3, 'B', 'A', 'C') ||
           two_top(x3, y3, x1, y1, x2, y2, 'C', 'A', 'B') ||
           two_top(x1, y1, x3, y3, x2, y2, 'A', 'C', 'B') ||
           two_top(x2, y2, x3, y3, x1, y1, 'B', 'C', 'A');
  if (!b) cout << -1 << endl;
  return 0;
}
