#include <bits/stdc++.h>
using namespace std;
class Point {
 public:
  int x;
  int y;
  char c;
};
int side, x, y;
bool breaker = false;
void find(char s[][300], char ch[], int t) {
  bool flag;
  for (int i = 0; i < side; i++) {
    for (int j = 0; j < side; j++) {
      flag = true;
      for (int k = 0; k <= t; k++) {
        if (ch[k] == s[i][j]) {
          flag = false;
        }
      }
      if (flag) {
        x = i;
        y = j;
        return;
      }
    }
  }
  x = side;
  y = side;
}
void print(char s[][300]) {
  cout << side << endl;
  for (int i = 0; i < side; i++) {
    for (int j = 0; j < side; j++) {
      cout << s[i][j];
    }
    cout << endl;
  }
}
bool add(Point p[], char q[][300], char ch[], int t, bool rotate) {
  if (t == 3) {
    find(q, ch, t);
    if (x == side && y == side) {
      print(q);
      breaker = true;
      return true;
    }
    return false;
  }
  char s[side][300];
  for (int i = 0; i < side; i++) {
    for (int j = 0; j < side; j++) {
      s[i][j] = q[i][j];
    }
  }
  int a, b;
  find(s, ch, t);
  a = x;
  b = y;
  if (rotate) {
    bool flag = true;
    for (int i = a; i < (p[ch[t] - 'A'].x) + a && flag; i++) {
      for (int j = b; j < (p[ch[t] - 'A'].y) + b && flag; j++) {
        if (i >= side || j >= side) {
          flag = !flag;
        }
        s[i][j] = ch[t];
      }
    }
    if (flag) {
      if (add(p, s, ch, t + 1, false)) {
        return true;
      }
      if (add(p, s, ch, t + 1, true)) {
        return true;
      }
    }
  } else {
    bool flag = true;
    for (int i = a; i < (p[ch[t] - 'A'].y) + a && flag; i++) {
      for (int j = b; j < (p[ch[t] - 'A'].x) + b && flag; j++) {
        if (i >= side || j >= side) {
          flag = !flag;
        }
        s[i][j] = ch[t];
      }
    }
    if (flag) {
      if (add(p, s, ch, t + 1, false)) {
        return true;
      }
      if (add(p, s, ch, t + 1, true)) {
        return true;
      }
    }
  }
  return false;
}
bool solve(char ch[], Point p[]) {
  char s[300][300];
  add(p, s, ch, 0, false);
  if (breaker) {
    return breaker;
  }
  add(p, s, ch, 0, true);
  return breaker;
}
int main() {
  char ch[] = {'A', 'B', 'C'};
  Point p[3];
  long total_area = 0;
  double square_side;
  for (int i = 0; i < 3; i++) {
    cin >> p[i].x >> p[i].y;
    total_area += p[i].x * p[i].y;
  }
  p[0].c = 'A';
  p[1].c = 'B';
  p[2].c = 'C';
  square_side = sqrt(total_area);
  side = (int)square_side;
  if (floor(square_side) != square_side) {
    cout << "-1";
    return 0;
  }
  for (int i = 0; i < 6; i++) {
    next_permutation(ch, ch + 3);
    if (solve(ch, p)) {
      return 0;
    }
  }
  cout << "-1" << endl;
  return 0;
}
