#include <bits/stdc++.h>
using namespace std;
void check1(int x1, int y1, int x2, int y2, int x3, int y3, char ch1, char ch2,
            char ch3) {
  if (y1 == y2 && y2 == y3 && y1 == x1 + x2 + x3) {
    cout << y1 << endl;
    for (int i = 1; i <= x1; i++) {
      for (int j = 1; j <= y1; j++) cout << ch1;
      cout << endl;
    }
    for (int i = 1; i <= x2; i++) {
      for (int j = 1; j <= y1; j++) cout << ch2;
      cout << endl;
    }
    for (int i = 1; i <= x3; i++) {
      for (int j = 1; j <= y1; j++) cout << ch3;
      cout << endl;
    }
    exit(0);
  }
}
void check2(int x1, int y1, int x2, int y2, int x3, int y3, char ch1, char ch2,
            char ch3) {
  if (x1 == x2 && y1 + y2 == y3 && x1 + x3 == y3) {
    cout << y3 << endl;
    for (int i = 1; i <= x1; i++) {
      for (int j = 1; j <= y1; j++) cout << ch1;
      for (int j = y1 + 1; j <= y3; j++) cout << ch2;
      cout << endl;
    }
    for (int i = 1; i <= x3; i++) {
      for (int j = 1; j <= y3; j++) cout << ch3;
      cout << endl;
    }
    exit(0);
  }
}
void check(int x1, int y1, int x2, int y2, int x3, int y3, char ch1, char ch2,
           char ch3) {
  check1(x1, y1, x2, y2, x3, y3, ch1, ch2, ch3);
  check2(x1, y1, x2, y2, x3, y3, ch1, ch2, ch3);
}
void rcheck(int x1, int y1, int x2, int y2, int x3, int y3, char ch1, char ch2,
            char ch3) {
  check(x1, y1, x2, y2, x3, y3, ch1, ch2, ch3);
  check(y1, x1, x2, y2, x3, y3, ch1, ch2, ch3);
  check(x1, y1, y2, x2, x3, y3, ch1, ch2, ch3);
  check(x1, y1, x2, y2, y3, x3, ch1, ch2, ch3);
  check(x1, y1, y2, x2, y3, x3, ch1, ch2, ch3);
  check(y1, x1, x2, y2, y3, x3, ch1, ch2, ch3);
  check(y1, x1, y2, x2, x3, y3, ch1, ch2, ch3);
  check(y1, x1, y2, x2, y3, x3, ch1, ch2, ch3);
}
int main() {
  ios::sync_with_stdio(false);
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  rcheck(x1, y1, x2, y2, x3, y3, 'A', 'B', 'C');
  rcheck(x1, y1, x3, y3, x2, y2, 'A', 'C', 'B');
  rcheck(x2, y2, x1, y1, x3, y3, 'B', 'A', 'C');
  rcheck(x2, y2, x3, y3, x1, y1, 'B', 'C', 'A');
  rcheck(x3, y3, x1, y1, x2, y2, 'C', 'A', 'B');
  rcheck(x3, y3, x2, y2, x1, y1, 'C', 'B', 'A');
  cout << -1;
}
