#include <bits/stdc++.h>
using namespace std;
struct logo {
  int x;
  int y;
  char S;
};
char NM1[500][500];
int main() {
  logo logos[3];
  int mm = 0;
  int mi = 0;
  for (int i = 0; i < 3; i++) {
    cin >> logos[i].x >> logos[i].y;
    if (logos[i].x > mm || logos[i].y > mm) {
      mm = max(logos[i].x, logos[i].y);
      mi = i;
    }
  }
  logos[0].S = 'A';
  logos[1].S = 'B';
  logos[2].S = 'C';
  if (mi != 0) {
    swap(logos[0], logos[mi]);
  }
  for (int i = 0; i < mm; i++)
    for (int j = 0; j < mm; j++) {
      NM1[i][j] = '.';
    }
  if (logos[0].x > logos[0].y) {
    swap(logos[0].x, logos[0].y);
  }
  for (int i = 0; i < logos[0].x; i++)
    for (int j = 0; j < logos[0].y; j++) {
      NM1[i][j] = logos[0].S;
    }
  if (logos[1].y == logos[0].y || logos[1].x == logos[0].y) {
    if (logos[1].x > logos[1].y) {
      swap(logos[1].x, logos[1].y);
    }
    if (logos[1].x + logos[0].x < logos[0].y) {
      for (int i = logos[0].x; i < logos[0].x + logos[1].x; i++) {
        for (int j = 0; j < logos[1].y; j++) {
          NM1[i][j] = logos[1].S;
        }
      }
      if (logos[2].x > logos[2].y) {
        swap(logos[2].x, logos[2].y);
      }
      if (logos[1].x + logos[0].x + logos[2].x == logos[0].y &&
          logos[2].y == logos[1].y) {
        for (int i = logos[0].x + logos[1].x; i < logos[0].y; i++) {
          for (int j = 0; j < logos[1].y; j++) {
            NM1[i][j] = logos[2].S;
          }
        }
        cout << mm << endl;
        for (int i = 0; i < logos[0].y; i++) {
          for (int j = 0; j < logos[0].y; j++) {
            cout << NM1[i][j];
          }
          cout << endl;
        }
        return 0;
      }
    }
  } else {
    if (logos[1].x + logos[0].x != logos[0].y) {
      swap(logos[1].x, logos[1].y);
    }
    if (logos[1].x + logos[0].x == logos[0].y) {
      for (int i = logos[0].x; i < logos[0].x + logos[1].x; i++) {
        for (int j = 0; j < logos[1].y; j++) {
          NM1[i][j] = logos[1].S;
        }
      }
      if (logos[2].x + logos[0].x != logos[0].y) {
        swap(logos[2].x, logos[2].y);
      }
      if (logos[2].x + logos[0].x == logos[0].y &&
          logos[2].y + logos[1].y == logos[0].y) {
        for (int i = logos[0].x; i < logos[0].y; i++) {
          for (int j = logos[1].y; j < logos[0].y; j++) {
            NM1[i][j] = logos[2].S;
          }
        }
        cout << mm << endl;
        for (int i = 0; i < logos[0].y; i++) {
          for (int j = 0; j < logos[0].y; j++) {
            cout << NM1[i][j];
          }
          cout << endl;
        }
        return 0;
      }
    }
  }
  cout << -1;
  return 0;
}
