#include <bits/stdc++.h>
using namespace std;
char grid[1000][1000];
int main() {
  for (int i = 0; i < 1000; i++) {
    for (int j = 0; j < 1000; j++) {
      grid[i][j] = '.';
    }
  }
  int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  int area = x1 * y1 + x2 * y2 + x3 * y3;
  int d, r;
  if (ceil(sqrt(area)) == floor(sqrt(area))) {
    d = sqrt(area);
    r = sqrt(area);
  } else {
    d = -1;
  }
  int yes = 0;
  if (x1 == d || y1 == d) {
    yes++;
    int need = x1 * y1;
    x1 = 0, y1 = 0;
    for (int i = 0; i < d && need > 0; i++) {
      for (int j = 0; j < d && need > 0; j++) {
        if (grid[i][j] == '.') {
          if (j == d - 1) r--;
          grid[i][j] = 'A';
          need--;
        }
      }
    }
  } else if (x2 == d || y2 == d) {
    yes++;
    int need = x2 * y2;
    x2 = 0, y2 = 0;
    for (int i = 0; i < d && need > 0; i++) {
      for (int j = 0; j < d && need > 0; j++) {
        if (grid[i][j] == '.') {
          if (j == d - 1) r--;
          grid[i][j] = 'B';
          need--;
        }
      }
    }
  } else if (x3 == d || y3 == d) {
    yes++;
    int need = x3 * y3;
    x3 = 0, y3 = 0;
    for (int i = 0; i < d && need > 0; i++) {
      for (int j = 0; j < d && need > 0; j++) {
        if (grid[i][j] == '.') {
          if (j == d - 1) r--;
          grid[i][j] = 'C';
          need--;
        }
      }
    }
  }
  int a[] = {x1, y1};
  int b[] = {x2, y2};
  int c[] = {x3, y3};
  int good = 0;
  char ans;
  for (int state = 0; state < 3; state++) {
    for (int i = 0; i < 2; i++) {
      for (int j = 0; j < 2; j++) {
        if (state == 0 && a[i] == b[j] && a[i] == d &&
            (a[1 - i] + b[1 - j] == r) && c[0] == 0 && c[1] == 0) {
          good = 1;
          ans = 'h';
        }
        if (state == 1 && a[i] == c[j] && a[i] == d &&
            (a[1 - i] + c[1 - j] == r) && b[0] == 0 && b[1] == 0) {
          good = 1;
          ans = 'h';
        }
        if (state == 2 && b[i] == c[j] && b[i] == d &&
            (b[1 - i] + c[1 - j] == r) && a[0] == 0 && a[1] == 0) {
          good = 1;
          ans = 'h';
        }
        if (state == 0 && a[i] == b[j] && a[i] == r &&
            (a[1 - i] + b[1 - j] == d) && c[0] == 0 && c[1] == 0) {
          good = 1;
          ans = 'v';
        }
        if (state == 1 && a[i] == c[j] && a[i] == r &&
            (a[1 - i] + c[1 - j] == d) && b[0] == 0 && b[1] == 0) {
          good = 1;
          ans = 'v';
        }
        if (state == 2 && b[i] == c[j] && b[i] == r &&
            (b[1 - i] + c[1 - j] == d) && a[0] == 0 && a[1] == 0) {
          good = 1;
          ans = 'v';
        }
      }
    }
  }
  if (d == -1 || yes == 0 || !good) {
    cout << -1;
  } else {
    if (ans == 'h') {
      int need = x1 * y1;
      for (int i = 0; i < d && need > 0; i++) {
        for (int j = 0; j < d && need > 0; j++) {
          if (grid[i][j] == '.') {
            grid[i][j] = 'A';
            need--;
          }
        }
      }
      need = x2 * y2;
      for (int i = 0; i < d && need > 0; i++) {
        for (int j = 0; j < d && need > 0; j++) {
          if (grid[i][j] == '.') {
            grid[i][j] = 'B';
            need--;
          }
        }
      }
      need = x3 * y3;
      for (int i = 0; i < d && need > 0; i++) {
        for (int j = 0; j < d && need > 0; j++) {
          if (grid[i][j] == '.') {
            grid[i][j] = 'C';
            need--;
          }
        }
      }
    } else if (ans == 'v') {
      int need = x1 * y1;
      for (int i = 0; i < d && need > 0; i++) {
        for (int j = 0; j < d && need > 0; j++) {
          if (grid[j][i] == '.') {
            grid[j][i] = 'A';
            need--;
          }
        }
      }
      need = x2 * y2;
      for (int i = 0; i < d && need > 0; i++) {
        for (int j = 0; j < d && need > 0; j++) {
          if (grid[j][i] == '.') {
            grid[j][i] = 'B';
            need--;
          }
        }
      }
      need = x3 * y3;
      for (int i = 0; i < d && need > 0; i++) {
        for (int j = 0; j < d && need > 0; j++) {
          if (grid[j][i] == '.') {
            grid[j][i] = 'C';
            need--;
          }
        }
      }
    }
    cout << d << endl;
    for (int i = 0; i < d; i++) {
      for (int j = 0; j < d; j++) {
        cout << grid[i][j];
      }
      cout << endl;
    }
  }
  return 0;
}
