#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:134217728")
using namespace std;
struct Rect {
  int w, h;
  Rect(int w = 0, int h = 0) : w(w), h(h) {}
  Rect swapped() { return Rect(h, w); }
  void scan() { cin >> w >> h; }
};
int main() {
  Rect rect[3];
  for (int i = 0; i < 3; ++i) {
    rect[i].scan();
  }
  for (int i = 0; i < (1 << 3); ++i) {
    Rect r[3];
    for (int j = 0; j < 3; ++j) {
      if (i >> j & 1) {
        r[j] = rect[j].swapped();
      } else {
        r[j] = rect[j];
      }
    }
    if (r[1].h == r[0].h && r[2].h == r[0].h) {
      if (r[0].w + r[1].w + r[2].w != r[0].h) {
        continue;
      }
      printf("%d\n", r[0].h);
      for (int hh = 0; hh < r[0].h; ++hh) {
        for (int j = 0; j < 3; ++j) {
          for (int ww = 0; ww < r[j].w; ++ww) {
            printf("%c", 'A' + j);
          }
        }
        printf("\n");
      }
      return 0;
    }
    for (int big = 0; big < 3; ++big) {
      int tw = -1;
      bool good = true;
      int sh = 0;
      for (int j = 0; j < 3; ++j) {
        if (j == big) {
          continue;
        }
        sh += r[j].h;
        if (tw == -1) {
          tw = r[j].w;
        } else {
          if (r[j].w != tw) {
            good = false;
          }
        }
      }
      if (!good) {
        continue;
      }
      if (r[big].h != sh) {
        continue;
      }
      if (tw + r[big].w != r[big].h) {
        continue;
      }
      printf("%d\n", r[big].h);
      for (int j = 0; j < 3; ++j) {
        if (j == big) {
          continue;
        }
        for (int hh = 0; hh < r[j].h; ++hh) {
          for (int ww = 0; ww < r[j].w; ++ww) {
            printf("%c", 'A' + j);
          }
          for (int ww = 0; ww < r[big].w; ++ww) {
            printf("%c", 'A' + big);
          }
          printf("\n");
        }
      }
      return 0;
    }
  }
  cout << -1 << endl;
  return 0;
}
