#include <bits/stdc++.h>
using namespace std;
int squaresize;
int x[3], y[3];
int board[501][501];
bool place(int l, int c, int logo, int ori) {
  int dim1, dim2;
  if (ori) {
    dim1 = x[logo];
    dim2 = y[logo];
  } else {
    dim1 = y[logo];
    dim2 = x[logo];
  }
  logo += 1;
  if (l + dim1 - 1 >= squaresize) {
    return 0;
  }
  if (c + dim2 - 1 >= squaresize) {
    return 0;
  }
  for (int i = l; i < l + dim1; i++) {
    for (int j = c; j < c + dim2; j++) {
      if (board[i][j]) {
        return 0;
      }
    }
  }
  for (int i = l; i < l + dim1; i++) {
    for (int j = c; j < c + dim2; j++) {
      board[i][j] = logo;
    }
  }
  return 1;
}
void remove(int l, int c, int logo, int ori) {
  int dim1, dim2;
  if (ori) {
    dim1 = x[logo];
    dim2 = y[logo];
  } else {
    dim1 = y[logo];
    dim2 = x[logo];
  }
  for (int i = l; i < l + dim1; i++) {
    for (int j = c; j < c + dim2; j++) {
      board[i][j] = 0;
    }
  }
}
int go(int mask) {
  if (mask == 7) {
    for (int i = 0; i < squaresize; i++) {
      for (int j = 0; j < squaresize; j++) {
        if (board[i][j] == 0) {
          return 0;
        }
      }
    }
    return 1;
  } else {
    int firstl, firstc;
    firstl = -1;
    firstc = -1;
    for (int i = 0; i < squaresize; i++) {
      for (int j = 0; j < squaresize; j++) {
        if (board[i][j] == 0) {
          firstl = i;
          firstc = j;
          break;
        }
      }
      if (firstl != -1) break;
    }
    if (firstl == -1) {
      return 0;
    }
    for (int i = 0; i < 3; i++) {
      if (!((mask >> i) & 1)) {
        if (place(firstl, firstc, i, 0)) {
          int res = go(mask | (1 << i));
          if (res) {
            return 1;
          }
          remove(firstl, firstc, i, 0);
        }
        if (place(firstl, firstc, i, 1)) {
          int res = go(mask | (1 << i));
          if (res) {
            return 1;
          }
          remove(firstl, firstc, i, 1);
        }
      }
    }
    return 0;
  }
}
int main() {
  ios::sync_with_stdio(0);
  int totalarea = 0;
  for (int i = 0; i < 3; i++) {
    cin >> x[i] >> y[i];
    totalarea += x[i] * y[i];
  }
  squaresize = -1;
  for (int i = 0; i <= 300; i++) {
    if (i * i == totalarea) {
      squaresize = i;
      break;
    }
  }
  if (squaresize == -1) {
    cout << -1 << "\n";
  } else {
    memset(board, 0, sizeof board);
    if (go(0)) {
      cout << squaresize << "\n";
      for (int i = 0; i < squaresize; i++) {
        for (int j = 0; j < squaresize; j++) {
          if (board[i][j] == 1) {
            cout << "A";
          } else if (board[i][j] == 2) {
            cout << "B";
          } else if (board[i][j] == 3) {
            cout << "C";
          }
        }
        cout << "\n";
      }
    } else {
      cout << -1 << "\n";
    }
  }
  return 0;
}
