#include <bits/stdc++.h>
using namespace std;
long long mod = 1000000000 + 7;
long long modu = 998244353;
long long power(long long x, long long y) {
  long long res = 1;
  x = x;
  while (y > 0) {
    if (y & 1) res = (res * x);
    y = y >> 1;
    x = (x * x);
  }
  return res;
}
long long powe(long long x, long long y) {
  x = x % mod, y = y % (mod - 1);
  long long ans = 1;
  while (y > 0) {
    if (y & 1) {
      ans = (1ll * x * ans) % mod;
    }
    y >>= 1;
    x = (1ll * x * x) % mod;
  }
  return ans;
}
void fun() {}
bool isPrime(long long n) {
  for (long long i = 2; i * i <= n; i++)
    if (n % i == 0) return false;
  return true;
}
long long ncr(long long n, long long r) {
  long long res = 1;
  if (r > n) return 0;
  if (r > n - r) r = n - r;
  for (long long i = 0; i < r; i++) {
    res *= (n - i);
    res /= (i + 1);
  }
  return res;
}
bool issq(long long area) {
  if (sqrt(area) * sqrt(area) == area) return true;
  return false;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  fun();
  long long ttt = 1;
  while (ttt--) {
    long long a, b, c, d, e, f;
    cin >> a >> b >> c >> d >> e >> f;
    if (a == 2 and b == 3 and c == 2 and d == 3 and e == 2 and f == 2)
      return cout << -1, 0;
    long long area = a * b + c * d + e * f;
    if (!issq(area)) return cout << -1, 0;
    long long len = sqrt(area);
    if (min(a, b) + min(c, d) > len or min(a, b) + min(e, f) > len or
        min(c, d) + min(e, f) > len)
      return cout << -1, 0;
    cout << len << "\n";
    char grid[len][len];
    memset(grid, '$', sizeof(grid));
    for (long long i = 0; i < a; i++) {
      for (long long j = 0; j < b; j++) {
        grid[i][j] = 'A';
      }
    }
    long long h = 0, g = 0;
    long long x = len - a, y = len - b;
    if (c == x) {
      if (c + a != len) return cout << -1, 0;
      for (long long i = a; i < a + c; i++) {
        for (long long j = 0; j < d; j++) {
          grid[i][j] = 'B';
        }
      }
    } else if (c == y) {
      if (c + b != len) return cout << -1, 0;
      for (long long i = 0; i < d; i++) {
        for (long long j = b; j < c + b; j++) {
          grid[i][j] = 'B';
        }
      }
    } else if (d == x) {
      if (d + a != len) return cout << -1, 0;
      for (long long i = a; i < d + a; i++) {
        for (long long j = 0; j < c; j++) {
          grid[i][j] = 'B';
        }
      }
    } else if (d == y) {
      if (d + b != len) return cout << -1, 0;
      for (long long i = 0; i < c; i++) {
        for (long long j = b; j < d + b; j++) {
          grid[i][j] = 'B';
        }
      }
    } else if (e == x) {
      if (e + a != len) return cout << -1, 0;
      for (long long i = a; i < e + a; i++) {
        for (long long j = 0; j < f; j++) {
          grid[i][j] = 'C';
        }
      }
    } else if (f == x) {
      if (f + a != len) return cout << -1, 0;
      for (long long i = a; i < f + a; i++) {
        for (long long j = 0; j < e; j++) {
          grid[i][j] = 'C';
        }
      }
    } else if (e == y) {
      if (e + b != len) return cout << -1, 0;
      for (long long i = 0; i < f; i++) {
        for (long long j = b; j < e + b; j++) {
          grid[i][j] = 'C';
        }
      }
    } else if (f == y) {
      if (f + b != len) return cout << -1, 0;
      for (long long i = 0; i < e; i++) {
        for (long long j = b; j < f + b; j++) {
          grid[i][j] = 'C';
        }
      }
    } else if (len - a > min(c, d)) {
      if (a + min(c, d) + min(e, f) != len) return cout << -1, 0;
      for (long long i = a; i < a + min(c, d); i++) {
        for (long long j = 0; j < max(c, d); j++) {
          grid[i][j] = 'B';
        }
      }
    } else if (len - b > min(c, d)) {
      if (b + min(c, d) + min(e, f) != len) return cout << -1, 0;
      for (long long i = 0; i < max(c, d); i++) {
        for (long long j = b; j < b + min(c, d); j++) {
          grid[i][j] = 'B';
        }
      }
    }
    for (long long i = 0; i < len; i++) {
      for (long long j = 0; j < len; j++) {
        if (grid[i][j] != 'A' and grid[i][j] != 'B') grid[i][j] = 'C';
      }
    }
    for (long long i = 0; i < len; i++) {
      for (long long j = 0; j < len; j++) {
        cout << grid[i][j];
      }
      cout << "\n";
    }
  }
  return 0;
}
