#include <bits/stdc++.h>
using namespace std;
long long max(long long a, long long b) { return (a > b) ? a : b; }
long long min(long long a, long long b) { return (a < b) ? a : b; }
long long gcd(long long a, long long b) { return (b) ? gcd(b, a % b) : a; }
long long modpow(long long n, long long k, long long mod) {
  long long ans = 1;
  while (k > 0) {
    if (k & 1) ans = (ans * n) % mod;
    k >>= 1;
    n = (n * n) % mod;
  }
  return ans % mod;
}
long long ab(long long a) { return (a > 0) ? a : -a; }
long long lcm(long long a, long long b) {
  return (a * b) / gcd(max(a, b), min(a, b));
}
long long poww(long long n, long long k) {
  long long ans = 1;
  while (k > 0) {
    if (k & 1) ans = (ans * n);
    k >>= 1;
    n = (n * n);
  }
  return ans;
}
double min(double a, double b) { return (a < b) ? a : b; }
double max(double a, double b) { return (a > b) ? a : b; }
double ab(double x) { return (x >= 0.0) ? x : -x; }
int random(int i) { return rand() % i; }
long long aa;
long long i, j;
bool check(long long x1, long long y1, char c1, long long x2, long long y2,
           char c2, long long x3, long long y3, char c3) {
  if (x1 == aa) {
    if (x2 == aa) {
      if (x3 == aa && y1 + y2 + y3 == aa) {
        cout << aa << endl;
        for (i = 0; i < y1; i++, cout << endl)
          for (j = 0; j < aa; j++) cout << c1;
        for (i = 0; i < y2; i++, cout << endl)
          for (j = 0; j < aa; j++) cout << c2;
        for (i = 0; i < y3; i++, cout << endl)
          for (j = 0; j < aa; j++) cout << c3;
        return 1;
      }
    }
    if (x2 + x3 == aa) {
      if (y2 == y3 && y1 + y2 == aa) {
        cout << aa << endl;
        for (i = 0; i < y1; i++, cout << endl)
          for (j = 0; j < aa; j++) cout << c1;
        for (i = 0; i < y2; i++, cout << endl)
          for (j = 0; j < aa; j++)
            if (j < x2)
              cout << c2;
            else
              cout << c3;
        return 1;
      }
    }
  } else if (x2 == aa) {
    if (x1 + x3 == aa) {
      if (y1 == y3 && y1 + y2 == aa) {
        return check(x2, y2, c2, x1, y1, c1, x3, y3, c3);
      }
    }
  } else if (x3 == aa) {
    if (x1 + x2 == aa) {
      if (y1 == y2 && y1 + y3 == aa) {
        return check(x3, y3, c3, x1, y1, c1, x2, y2, c2);
      }
    }
  } else if (x1 + x2 == aa) {
    if (y1 != y2) {
      if (y2 > y1) return check(x2, y2, c2, x1, y1, c1, x3, y3, c3);
      if (y1 == aa) {
        if (x3 + x1 == aa && y2 + y3 == aa) {
          cout << aa << endl;
          for (i = 0; i < aa; i++, cout << endl) {
            for (j = 0; j < aa; j++) {
              if (j < x1)
                cout << c1;
              else if (i < y2)
                cout << c2;
              else
                cout << c3;
            }
          }
          return 1;
        }
      }
    }
  } else if (x1 + x3 == aa) {
    return check(x1, y1, c1, x3, y3, c3, x2, y2, c2);
  } else if (x2 + x3 == aa) {
    return check(x2, y2, c2, x3, y3, c3, x1, y1, c1);
  } else if (x1 + x2 + x3 == aa) {
    if (y1 == y2 && y2 == y3 && y3 == aa) {
      cout << aa << endl;
      for (i = 0; i < aa; i++, cout << endl)
        for (j = 0; j < aa; j++) {
          if (j < x1)
            cout << c1;
          else if (j < x1 + x2)
            cout << c2;
          else
            cout << c3;
        }
      return 1;
    }
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(false);
  long long x1, x2, x3, y1, y2, y3;
  long long a1, a2, a3, a;
  char c1 = 'A', c2 = 'B', c3 = 'C';
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  a1 = x1 * y1;
  a2 = x2 * y2;
  a3 = x3 * y3;
  a = a1 + a2 + a3;
  aa = sqrt(a);
  if (aa * aa != a) {
    cout << "-1" << endl;
    return 0;
  }
  if (check(x1, y1, c1, x2, y2, c2, x3, y3, c3)) {
    return 0;
  }
  if (check(y1, x1, c1, x2, y2, c2, x3, y3, c3)) {
    return 0;
  }
  if (check(x1, y1, c1, y2, x2, c2, x3, y3, c3)) {
    return 0;
  }
  if (check(y1, x1, c1, y2, x2, c2, x3, y3, c3)) {
    return 0;
  }
  if (check(x1, y1, c1, x2, y2, c2, y3, x3, c3)) {
    return 0;
  }
  if (check(y1, x1, c1, x2, y2, c2, y3, x3, c3)) {
    return 0;
  }
  if (check(x1, y1, c1, y2, x2, c2, y3, x3, c3)) {
    return 0;
  }
  if (check(y1, x1, c1, y2, x2, c2, y3, x3, c3)) {
    return 0;
  }
  cout << "-1" << endl;
  return 0;
}
