#include <bits/stdc++.h>
using namespace std;
long int flag[3], sqr, temp;
char mat[1000][1000];
struct rect {
  long int x;
  long int y;
} A1, B1, C1, A2, B2, C2;
long int check(rect A, rect B, rect C, long int x, long int y) {
  if (flag[0] && flag[1] && flag[2]) {
    cout << temp << endl;
    long int i, j;
    for (i = A1.y; i < A2.y; i++)
      for (j = A1.x; j < A2.x; j++) mat[i][j] = 'A';
    for (i = B1.y; i < B2.y; i++)
      for (j = B1.x; j < B2.x; j++) mat[i][j] = 'B';
    for (i = C1.y; i < C2.y; i++)
      for (j = C1.x; j < C2.x; j++) mat[i][j] = 'C';
    for (i = 0; i < temp; i++) {
      for (j = 0; j < temp; j++) cout << mat[i][j];
      cout << endl;
    }
    return 1;
  }
  long int value;
  if (flag[0] == 0) {
    flag[0] = 1;
    if ((x + A.x == temp || y + A.y == temp) &&
        (x + A.x <= temp && y + A.y <= temp)) {
      A1.x = x;
      A1.y = y;
      A2.x = x + A.x;
      A2.y = y + A.y;
      if (x + A.x == temp)
        value = check(A, B, C, x, y + A.y);
      else
        value = check(A, B, C, x + A.x, y);
      if (value == 1) return 1;
    }
    if ((x + A.y == temp || y + A.x == temp) &&
        (x + A.y <= temp && y + A.x <= temp)) {
      A1.x = x;
      A1.y = y;
      A2.x = x + A.y;
      A2.y = y + A.x;
      if (x + A.y == temp)
        value = check(A, B, C, x, y + A.x);
      else
        value = check(A, B, C, x + A.y, y);
      if (value == 1) return 1;
    }
    flag[0] = 0;
  }
  if (flag[1] == 0) {
    flag[1] = 1;
    if ((x + B.x == temp || y + B.y == temp) &&
        (x + B.x <= temp && y + B.y <= temp)) {
      B1.x = x;
      B1.y = y;
      B2.x = x + B.x;
      B2.y = y + B.y;
      if (x + B.x == temp)
        value = check(A, B, C, x, y + B.y);
      else
        value = check(A, B, C, x + B.x, y);
      if (value == 1) return 1;
    }
    if ((x + B.y == temp || y + B.x == temp) &&
        (x + B.y <= temp && y + B.x <= temp)) {
      B1.x = x;
      B1.y = y;
      B2.x = x + B.y;
      B2.y = y + B.x;
      if (x + B.y == temp)
        value = check(A, B, C, x, y + B.x);
      else
        value = check(A, B, C, x + B.y, y);
      if (value == 1) return 1;
    }
    flag[1] = 0;
  }
  if (flag[2] == 0) {
    flag[2] = 1;
    if ((x + C.x == temp || y + C.y == temp) &&
        (x + C.x <= temp && y + C.y <= temp)) {
      C1.x = x;
      C1.y = y;
      C2.x = x + C.x;
      C2.y = y + C.y;
      if (x + C.x == temp)
        value = check(A, B, C, x, y + C.y);
      else
        value = check(A, B, C, x + C.x, y);
      if (value == 1) return 1;
    }
    if ((x + C.y == temp || y + C.x == temp) &&
        (x + C.y <= temp && y + C.x <= temp)) {
      C1.x = x;
      C1.y = y;
      C2.x = x + C.y;
      C2.y = y + C.x;
      if (x + C.y == temp)
        value = check(A, B, C, x, y + C.x);
      else
        value = check(A, B, C, x + C.y, y);
      if (value == 1) return 1;
    }
    flag[2] = 0;
  }
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  rect A, B, C;
  long int ans;
  cin >> A.x >> A.y >> B.x >> B.y >> C.x >> C.y;
  sqr = A.x * A.y + B.x * B.y + C.x * C.y;
  temp = (int)(sqrt(sqr));
  if (temp * temp == sqr) {
    ans = check(A, B, C, 0, 0);
    if (ans == 1)
      ;
    else
      cout << "-1";
  } else {
    cout << "-1";
  }
}
