#include <bits/stdc++.h>
using namespace std;
struct point {
  int x;
  int y;
};
point invert(point a) {
  point p;
  p.x = a.y;
  p.y = a.x;
  return p;
}
void printSuccessive(point a, point b, point c, char c1, char c2, char c3) {
  cout << a.y << endl;
  for (int i = 0; i < a.y; ++i) {
    for (int j = 0; j < a.x; ++j) cout << c1;
    for (int j = 0; j < b.x; ++j) cout << c2;
    for (int j = 0; j < c.x; ++j) cout << c3;
    cout << endl;
  }
}
void printTwoOnTop(point a, point b, point c, char c1, char c2, char c3) {
  cout << a.y + c.y << endl;
  for (int i = 0; i < a.y; ++i) {
    for (int j = 0; j < a.x; ++j) cout << c1;
    for (int j = 0; j < b.x; ++j) cout << c2;
    cout << endl;
  }
  for (int i = 0; i < c.y; ++i) {
    for (int j = 0; j < c.x; ++j) cout << c3;
    cout << endl;
  }
}
void printOnTop(point a, point b, point c, char c1, char c2, char c3) {
  cout << a.x << endl;
  for (int i = 0; i < a.y; ++i) {
    for (int j = 0; j < a.x; ++j) cout << c1;
    cout << endl;
  }
  for (int i = 0; i < b.y; ++i) {
    for (int j = 0; j < b.x; ++j) cout << c2;
    cout << endl;
  }
  for (int i = 0; i < c.y; ++i) {
    for (int j = 0; j < c.x; ++j) cout << c3;
    cout << endl;
  }
}
int main() {
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  point a, b, c;
  a.x = x1;
  a.y = y1;
  b.x = x2;
  b.y = y2;
  c.x = x3;
  c.y = y3;
  point pts[3];
  pts[0] = a;
  pts[1] = b;
  pts[2] = c;
  int masks[] = {0b100, 0b010, 0b001};
  int invertCombs[8] = {0, 0b100, 0b010, 0b001, 0b110, 0b101, 0b011, 0b111};
  for (int i = 0; i < 8; ++i) {
    for (int j = 0; j < 3; ++j) {
      for (int k = 0; k < 3; ++k) {
        int k1, k2;
        if (k == 0)
          k1 = 1, k2 = 2;
        else if (k == 1)
          k1 = 2, k2 = 0;
        else
          k1 = 0, k2 = 1;
        point v1 = pts[k], v2 = pts[k1], v3 = pts[k2];
        if (invertCombs[i] & masks[k]) v1 = invert(v1);
        if (invertCombs[i] & masks[k1]) v2 = invert(v2);
        if (invertCombs[i] & masks[k2]) v3 = invert(v3);
        if (j == 0) {
          if (v1.y == v2.y && v2.y == v3.y && v1.x + v2.x + v3.x == v2.y) {
            printSuccessive(v1, v2, v3, k + 'A', k1 + 'A', k2 + 'A');
            return 0;
          }
        } else if (j == 1) {
          if (v1.x + v2.x == v3.x && v1.y == v2.y && v1.y + v3.y == v3.x) {
            printTwoOnTop(v1, v2, v3, k + 'A', k1 + 'A', k2 + 'A');
            return 0;
          }
        } else {
          if (v1.x == v2.x && v2.x == v3.x && v1.y + v2.y + v3.y == v2.x) {
            printOnTop(v1, v2, v3, k + 'A', k1 + 'A', k2 + 'A');
            return 0;
          }
        }
      }
    }
  }
  cout << -1;
  return 0;
}
