#include <bits/stdc++.h>
using namespace std;
int x[4], y[4], bill[500][500], kenar;
int main() {
  int ans = 0;
  for (int i = 1; i <= 3; i++) {
    scanf("%d %d", x + i, y + i);
    ans += x[i] * y[i];
  }
  if (sqrt(ans) * sqrt(ans) != ans) {
    puts("-1");
    return 0;
  }
  kenar = sqrt(ans);
  for (int i = 1; i <= 3; i++)
    if (x[i] > kenar || y[i] > kenar) {
      puts("-1");
      return 0;
    }
  if (x[1] > y[1]) swap(x[1], y[1]);
  for (int i = 2; i <= 3; i++)
    if (x[i] > y[i]) swap(x[i], y[i]);
  for (int i = 1; i <= x[1]; i++)
    for (int j = 1; j <= y[1]; j++) bill[i][j] = 1;
  if (kenar == y[1]) {
    bool con = 0;
    if (y[2] == kenar && y[3] == kenar && x[2] + x[3] == kenar - x[1]) {
      for (int i = x[1] + 1; i <= x[1] + x[2]; i++)
        for (int j = 1; j <= kenar; j++) bill[i][j] = 2;
      for (int i = x[1] + x[2] + 1; i <= kenar; i++)
        for (int j = 1; j <= kenar; j++) bill[i][j] = 3;
      con = 1;
    } else {
      if (x[2] == x[3] && x[2] == kenar - x[1] && y[2] + y[3] == kenar) {
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = 1; j <= y[2]; j++) bill[i][j] = 2;
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = y[2] + 1; j <= kenar; j++) bill[i][j] = 3;
        con = 1;
      } else if (x[2] == y[3] && x[2] == kenar - x[1] && y[2] + x[3] == kenar) {
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = 1; j <= y[2]; j++) bill[i][j] = 2;
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = y[2] + 1; j <= kenar; j++) bill[i][j] = 3;
        con = 1;
      }
      if (y[2] == x[3] && y[2] == kenar - x[1] && x[2] + y[3] == kenar) {
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = 1; j <= x[2]; j++) bill[i][j] = 2;
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = x[2] + 1; j <= kenar; j++) bill[i][j] = 3;
        con = 1;
      }
      if (y[2] == y[3] && y[2] == kenar - x[1] && x[2] + x[3] == kenar) {
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = 1; j <= x[2]; j++) bill[i][j] = 2;
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = x[2] + 1; j <= kenar; j++) bill[i][j] = 3;
        con = 1;
      }
    }
    if (!con) {
      puts("-1");
      return 0;
    }
  } else {
    int con = 0;
    for (int i = 2; i <= 3; i++) {
      if (x[i] == kenar - y[1] && y[i] == kenar) con = i;
      if (y[i] == kenar - y[1] && x[i] == kenar) con = i;
    }
    if (con) {
      if (x[con] == kenar - y[1]) {
        for (int i = 1; i <= y[con]; i++)
          for (int j = y[1] + 1; j <= kenar; j++) bill[i][j] = con;
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = 1; j <= y[1]; j++) bill[i][j] = 5 - con;
      } else {
        for (int i = 1; i <= y[con]; i++)
          for (int j = y[1] + 1; j <= kenar; j++) bill[i][j] = con;
        for (int i = x[1] + 1; i <= kenar; i++)
          for (int j = 1; j <= y[1]; j++) bill[i][j] = 5 - con;
      }
    }
    if (!con) {
      for (int i = 2; i <= 3; i++) {
        if (x[i] == kenar - y[1] && y[i] == x[1] && y[5 - i] == kenar &&
            x[5 - i] == kenar - x[1])
          con = i;
        if (y[i] == kenar - y[1] && x[i] == x[1] && y[5 - i] == kenar &&
            x[5 - i] == kenar - x[1])
          con = i;
      }
      if (!con) {
        puts("-1");
        return 0;
      }
      for (int i = 1; i <= x[1]; i++)
        for (int j = y[1] + 1; j <= kenar; j++) bill[i][j] = con;
      for (int i = x[1] + 1; i <= kenar; i++)
        for (int j = 1; j <= kenar; j++) bill[i][j] = 5 - con;
    }
  }
  printf("%d\n", kenar);
  for (int i = 1; i <= kenar; i++, puts(""))
    for (int j = 1; j <= kenar; j++) printf("%c", 'A' + bill[i][j] - 1);
  return 0;
}
