#include <bits/stdc++.h>
using namespace std;
int x[4], y[4], n = 0, k[4], l[3], m[3], s[3];
int main() {
  for (int i = 1; i <= 3; i++) {
    scanf("%d %d", &x[i], &y[i]);
    if (x[i] > n) n = x[i];
    if (y[i] > n) n = y[i];
  }
  if (x[1] * y[1] + x[2] * y[2] + x[3] * y[3] != n * n) {
    printf("-1");
    return 0;
  }
  int cnt = 0;
  for (int i = 1; i <= 3; i++) {
    if (x[i] == n || y[i] == n) cnt++;
  }
  if (cnt == 3) {
    int sum = 0;
    for (int i = 1; i <= 3; i++) {
      if (x[i] != n) {
        sum += x[i];
        k[i] = x[i];
      }
      if (y[i] != n) {
        sum += y[i];
        k[i] = y[i];
      }
    }
    if (sum != n) {
      printf("-1");
      return 0;
    } else {
      printf("%d\n", n);
      for (int j = 1; j <= k[1]; j++) {
        for (int l = 1; l <= n; l++) printf("A");
        printf("\n");
      }
      for (int j = 1; j <= k[2]; j++) {
        for (int l = 1; l <= n; l++) printf("B");
        printf("\n");
      }
      for (int j = 1; j <= k[3]; j++) {
        for (int l = 1; l <= n; l++) printf("C");
        printf("\n");
      }
      return 0;
    }
  }
  int q;
  printf("%d\n", n);
  for (int i = 1; i <= 3; i++) {
    if (x[i] == n) {
      l[1] = n;
      l[2] = y[i];
      q = i;
      break;
    }
    if (y[i] == n) {
      l[1] = n;
      l[2] = x[i];
      q = i;
      break;
    }
  }
  if (q == 1) {
    for (int i = 1; i <= l[2]; i++) {
      for (int j = 1; j <= n; j++) printf("A");
      printf("\n");
    }
  } else if (q == 2) {
    for (int i = 1; i <= l[2]; i++) {
      for (int j = 1; j <= n; j++) printf("B");
      printf("\n");
    }
  } else if (q == 3) {
    for (int i = 1; i <= l[2]; i++) {
      for (int j = 1; j <= n; j++) printf("C");
      printf("\n");
    }
  }
  int p, r;
  p = q - 1;
  r = q + 1;
  if (!p) p = 3;
  if (r == 4) r = 1;
  if (x[p] + x[r] == n) {
    m[1] = x[p];
    m[2] = y[p];
    s[1] = x[r];
    s[2] = y[r];
  } else if (x[p] + y[r] == n) {
    m[1] = x[p];
    m[2] = y[p];
    s[1] = y[r];
    s[2] = x[r];
  } else if (y[p] + y[r] == n) {
    m[1] = y[p];
    m[2] = x[p];
    s[1] = y[r];
    s[2] = x[r];
  } else if (y[p] + x[r] == n) {
    m[1] = y[p];
    m[2] = x[p];
    s[1] = x[r];
    s[2] = y[r];
  }
  for (int i = 1; i <= m[2]; i++) {
    if (p == 1) {
      for (int j = 1; j <= m[1]; j++) printf("A");
    }
    if (p == 2) {
      for (int j = 1; j <= m[1]; j++) printf("B");
    }
    if (p == 3) {
      for (int j = 1; j <= m[1]; j++) printf("C");
    }
    if (r == 1) {
      for (int j = 1; j <= s[1]; j++) printf("A");
    }
    if (r == 2) {
      for (int j = 1; j <= s[1]; j++) printf("B");
    }
    if (r == 3) {
      for (int j = 1; j <= s[1]; j++) printf("C");
    }
    printf("\n");
  }
  return 0;
}
