#include <bits/stdc++.h>
using namespace std;
const int oo = 1000000009;
const double eps = 1e-9;
const int mod = 1000000007;
int main() {
  int a[6], b[6];
  for (int i = 0; i < 6; ++i) scanf("%d", &a[i]);
  for (int i = 0; i < 3; ++i) {
    b[2 * i] = ((a[2 * i]) < (a[2 * i + 1]) ? (a[2 * i]) : (a[2 * i + 1]));
    b[2 * i + 1] = ((a[2 * i]) > (a[2 * i + 1]) ? (a[2 * i]) : (a[2 * i + 1]));
  }
  if (b[1] == b[3] && b[1] == b[5] && b[1] == (b[0] + b[2] + b[4])) {
    printf("%d\n", b[1]);
    for (int i = 0; i < b[0]; ++i) {
      for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
      printf("\n");
    }
    for (int i = 0; i < b[2]; ++i) {
      for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
      printf("\n");
    }
    for (int i = 0; i < b[4]; ++i) {
      for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
      printf("\n");
    }
    return 0;
  } else {
    if (b[1] > b[3] && b[1] > b[5]) {
      if (b[2] == b[4] && b[0] + b[2] == b[1] && b[3] + b[5] == b[1]) {
        printf("%d\n", b[1]);
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          printf("\n");
        }
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      } else if (b[2] == b[5] && b[0] + b[2] == b[1] && b[3] + b[4] == b[1]) {
        printf("%d\n", b[1]);
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          printf("\n");
        }
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          for (int j = 0; j < b[4]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      } else if (b[3] == b[4] && b[0] + b[3] == b[1] && b[2] + b[5] == b[1]) {
        printf("%d\n", b[1]);
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          printf("\n");
        }
        for (int i = 0; i < b[3]; ++i) {
          for (int j = 0; j < b[2]; ++j) printf("%c", 'B');
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      } else if (b[3] == b[5] && b[0] + b[3] == b[1] && b[2] + b[4] == b[1]) {
        printf("%d\n", b[1]);
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          printf("\n");
        }
        for (int i = 0; i < b[3]; ++i) {
          for (int j = 0; j < b[2]; ++j) printf("%c", 'B');
          for (int j = 0; j < b[4]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      }
    } else if (b[3] > b[1] && b[3] > b[5]) {
      if (b[0] == b[4] && b[2] + b[0] == b[3] && b[1] + b[5] == b[3]) {
        printf("%d\n", b[3]);
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          printf("\n");
        }
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      } else if (b[0] == b[5] && b[2] + b[0] == b[3] && b[1] + b[4] == b[3]) {
        printf("%d\n", b[3]);
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          printf("\n");
        }
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[4]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      } else if (b[1] == b[4] && b[2] + b[1] == b[3] && b[0] + b[5] == b[3]) {
        printf("%d\n", b[3]);
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          printf("\n");
        }
        for (int i = 0; i < b[1]; ++i) {
          for (int j = 0; j < b[0]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      } else if (b[1] == b[5] && b[2] + b[1] == b[3] && b[0] + b[4] == b[3]) {
        printf("%d\n", b[3]);
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          printf("\n");
        }
        for (int i = 0; i < b[1]; ++i) {
          for (int j = 0; j < b[0]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[4]; ++j) printf("%c", 'C');
          printf("\n");
        }
        return 0;
      }
    } else if (b[5] > b[1] && b[5] > b[3]) {
      if (b[0] == b[2] && b[4] + b[0] == b[5] && b[3] + b[1] == b[5]) {
        printf("%d\n", b[5]);
        for (int i = 0; i < b[4]; ++i) {
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        for (int i = 0; i < b[2]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          printf("\n");
        }
        return 0;
      } else if (b[0] == b[3] && b[4] + b[0] == b[5] && b[1] + b[2] == b[5]) {
        printf("%d\n", b[5]);
        for (int i = 0; i < b[4]; ++i) {
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        for (int i = 0; i < b[0]; ++i) {
          for (int j = 0; j < b[1]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[2]; ++j) printf("%c", 'B');
          printf("\n");
        }
        return 0;
      } else if (b[3] == b[1] && b[4] + b[1] == b[5] && b[0] + b[2] == b[5]) {
        printf("%d\n", b[5]);
        for (int i = 0; i < b[4]; ++i) {
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        for (int i = 0; i < b[3]; ++i) {
          for (int j = 0; j < b[0]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[2]; ++j) printf("%c", 'B');
          printf("\n");
        }
        return 0;
      } else if (b[1] == b[2] && b[4] + b[1] == b[5] && b[0] + b[3] == b[5]) {
        printf("%d\n", b[5]);
        for (int i = 0; i < b[4]; ++i) {
          for (int j = 0; j < b[5]; ++j) printf("%c", 'C');
          printf("\n");
        }
        for (int i = 0; i < b[1]; ++i) {
          for (int j = 0; j < b[0]; ++j) printf("%c", 'A');
          for (int j = 0; j < b[3]; ++j) printf("%c", 'B');
          printf("\n");
        }
        return 0;
      }
    }
  }
  printf("%d\n", -1);
}
