#include <bits/stdc++.h>
using namespace std;
int main() {
  int A[2], B[2], C[2];
  scanf("%d %d %d %d %d %d", &A[0], &A[1], &B[0], &B[1], &C[0], &C[1]);
  int r1 = A[0];
  int r2 = B[0];
  int r3 = C[0];
  int c1 = A[1];
  int c2 = B[1];
  int c3 = C[1];
  bool check = false;
  int row1, row2, row3, col1, col2, col3;
  for (int i = 0; i < (1 << 3); i++) {
    A[0] = r1;
    B[0] = r2;
    C[0] = r3;
    A[1] = c1;
    B[1] = c2;
    C[1] = c3;
    if ((i & 1) == 1) {
      swap(A[0], A[1]);
    }
    if (((i >> 1) & 1) == 1) {
      swap(B[0], B[1]);
    }
    if (((i >> 2) & 1) == 1) {
      swap(C[0], C[1]);
    }
    if (A[0] == B[0] && B[0] == C[0] && A[0] == A[1] + B[1] + C[1]) {
      row1 = A[1];
      row2 = B[1];
      row3 = C[1];
      col1 = A[0];
      printf("%d\n", col1);
      for (int i = 0; i < row1; i++) {
        for (int j = 0; j < col1; j++) {
          printf("A");
        }
        printf("\n");
      }
      for (int i = 0; i < row2; i++) {
        for (int j = 0; j < col1; j++) {
          printf("B");
        }
        printf("\n");
      }
      for (int i = 0; i < row3; i++) {
        for (int j = 0; j < col1; j++) {
          printf("C");
        }
        printf("\n");
      }
      return 0;
    }
    if (A[0] == B[0] + C[0] && B[1] == C[1] && A[0] == A[1] + B[1]) {
      row1 = A[1];
      row2 = B[1];
      col1 = A[0];
      col2 = B[0];
      col3 = C[0];
      printf("%d\n", col1);
      for (int i = 0; i < row1; i++) {
        for (int j = 0; j < col1; j++) {
          printf("A");
        }
        printf("\n");
      }
      for (int i = 0; i < row2; i++) {
        for (int j = 0; j < col2; j++) {
          printf("B");
        }
        for (int j = 0; j < col3; j++) {
          printf("C");
        }
        printf("\n");
      }
      return 0;
    }
    if (B[0] == A[0] + C[0] && A[1] == C[1] && B[0] == B[1] + C[1]) {
      row1 = B[1];
      row2 = A[1];
      col1 = B[0];
      col2 = A[0];
      col3 = C[0];
      printf("%d\n", col1);
      for (int i = 0; i < row1; i++) {
        for (int j = 0; j < col1; j++) {
          printf("B");
        }
        printf("\n");
      }
      for (int i = 0; i < row2; i++) {
        for (int j = 0; j < col2; j++) {
          printf("A");
        }
        for (int j = 0; j < col3; j++) {
          printf("C");
        }
        printf("\n");
      }
      return 0;
    }
    if (C[0] == A[0] + B[0] && A[1] == B[1] && C[0] == A[1] + C[1]) {
      row1 = C[1];
      row2 = A[1];
      col1 = C[0];
      col2 = A[0];
      col3 = B[0];
      printf("%d\n", col1);
      for (int i = 0; i < row1; i++) {
        for (int j = 0; j < col1; j++) {
          printf("C");
        }
        printf("\n");
      }
      for (int i = 0; i < row2; i++) {
        for (int j = 0; j < col2; j++) {
          printf("A");
        }
        for (int j = 0; j < col3; j++) {
          printf("B");
        }
        printf("\n");
      }
      return 0;
    }
  }
  if (!check) {
    printf("-1");
    return 0;
  }
}
