#include <bits/stdc++.h>
using namespace std;
int X[4], Y[4], nRes;
int Res[205][205];
bool Flag, Found;
void MakeLogos(int x1, int y1, int x2, int y2, int Type) {
  for (int i = x1; i <= x2; i++)
    for (int j = y1; j <= y2; j++) Res[i][j] = Type;
}
void Retry() {
  for (int i = 1; i <= 200; i++)
    for (int j = 1; j <= 200; j++) Res[i][j] = 0;
}
void Check(int i, int j, int k) {
  int t;
  if (X[i] == Y[j]) {
    t = Y[j];
    Y[j] = X[j];
    X[j] = t;
  } else if (Y[i] == X[j]) {
    t = Y[i];
    Y[i] = X[i];
    X[i] = t;
  } else if (Y[i] == Y[j]) {
    t = Y[j];
    Y[j] = X[j];
    X[j] = t;
    t = Y[i];
    Y[i] = X[i];
    X[i] = t;
  }
  if (X[i] == X[j]) {
    MakeLogos(1, 1, X[i], Y[i], i);
    MakeLogos(1, Y[i] + 1, X[i], Y[i] + Y[j], j);
    int xNew = X[i], yNew = Y[i] + Y[j];
    if (xNew == X[k] && yNew + Y[k] == xNew) {
      Found = true;
      MakeLogos(1, yNew + 1, xNew, yNew + Y[k], k);
      nRes = xNew;
      return;
    }
    if (xNew == Y[k] && yNew + X[k] == xNew) {
      Found = true;
      MakeLogos(1, yNew + 1, xNew, yNew + X[k], k);
      nRes = xNew;
      return;
    }
    if (yNew == X[k] && xNew + Y[k] == yNew) {
      Found = true;
      MakeLogos(xNew + 1, 1, xNew + Y[k], yNew, k);
      nRes = yNew;
      return;
    }
    if (yNew == Y[k] && xNew + X[k] == yNew) {
      Found = true;
      MakeLogos(xNew + 1, 1, xNew + X[k], yNew, k);
      nRes = yNew;
      return;
    }
  }
}
void PrintResult() {
  cout << nRes << endl;
  for (int i = 1; i <= nRes; i++) {
    for (int j = 1; j <= nRes; j++) {
      if (Res[i][j] == 1) cout << 'A';
      if (Res[i][j] == 2) cout << 'B';
      if (Res[i][j] == 3) cout << 'C';
    }
    cout << endl;
  }
}
int main() {
  cin >> X[1] >> Y[1] >> X[2] >> Y[2] >> X[3] >> Y[3];
  int Sum = X[1] * Y[1] + X[2] * Y[2] + X[3] * Y[3];
  for (int i = 1; i <= 200; i++) {
    if (i * i == Sum) {
      Flag = true;
      break;
    }
  }
  if (!Flag)
    cout << -1 << endl;
  else {
    Found = false;
    Check(1, 2, 3);
    if (Found) {
      PrintResult();
      return 0;
    } else
      Retry();
    Check(1, 3, 2);
    if (Found) {
      PrintResult();
      return 0;
    } else
      Retry();
    Check(2, 3, 1);
    if (Found) {
      PrintResult();
      return 0;
    } else
      cout << -1 << endl;
  }
  return 0;
}
