#include <bits/stdc++.h>
using namespace std;
int main() {
  int a[2], b[2], c[2];
  cin >> a[0] >> a[1] >> b[0] >> b[1] >> c[0] >> c[1];
  int sz = a[0] * a[1] + b[0] * b[1] + c[0] * c[1];
  bool f = false;
  for (int i = 0; i < 200; i++) {
    if (sz == i * i) {
      f = true;
      sz = i;
    }
  }
  if (!f) {
    cout << -1 << endl;
    return 0;
  } else {
    int k[3];
    if (a[0] == sz)
      k[0] = 0;
    else if (a[1] == sz)
      k[0] = 1;
    else
      f = false;
    if (b[0] == sz)
      k[1] = 0;
    else if (b[1] == sz)
      k[1] = 1;
    else
      f = false;
    if (c[0] == sz)
      k[2] = 0;
    else if (c[1] == sz)
      k[2] = 1;
    else
      f = false;
    if (f == true) {
      cout << sz << endl;
      for (int i = 0; i < a[!k[0]]; i++) {
        for (int i = 0; i < sz; i++) cout << "A";
        cout << endl;
      }
      for (int i = 0; i < b[!k[1]]; i++) {
        for (int i = 0; i < sz; i++) cout << "B";
        cout << endl;
      }
      for (int i = 0; i < c[!k[2]]; i++) {
        for (int i = 0; i < sz; i++) cout << "C";
        cout << endl;
      }
    } else {
      int kk = -1;
      int p = -1;
      int P1, P2;
      if (sz == a[0]) {
        kk = 0;
        p = 0;
        P1 = 1, P2 = 2;
      }
      if (sz == a[1]) {
        kk = 0;
        p = 1;
        P1 = 1, P2 = 2;
      }
      if (sz == b[0]) {
        kk = 1;
        p = 0;
        P1 = 0, P2 = 2;
      }
      if (sz == b[1]) {
        kk = 1;
        p = 1;
        P1 = 0, P2 = 2;
      }
      if (sz == c[0]) {
        kk = 2;
        p = 0;
        P1 = 1, P2 = 0;
      }
      if (sz == c[1]) {
        kk = 2;
        p = 1;
        P1 = 1, P2 = 0;
      }
      if (kk != -1) {
        if (kk == 0) {
          int ss = sz - a[!p];
          if (b[0] == ss) k[1] = 0;
          if (b[1] == ss) k[1] = 1;
          if (c[0] == ss) k[2] = 0;
          if (c[1] == ss) k[2] = 1;
          cout << sz << endl;
          for (int i = 0; i < a[!p]; i++) {
            for (int i = 0; i < sz; i++) cout << "A";
            cout << endl;
          }
          for (int i = 0; i < ss; i++) {
            for (int i = 0; i < b[!k[1]]; i++) cout << "B";
            for (int i = 0; i < c[!k[2]]; i++) cout << "C";
            cout << endl;
          }
          f = true;
        }
        if (kk == 1) {
          int ss = sz - b[!p];
          if (a[0] == ss) k[0] = 0;
          if (a[1] == ss) k[0] = 1;
          if (c[0] == ss) k[2] = 0;
          if (c[1] == ss) k[2] = 1;
          cout << sz << endl;
          for (int i = 0; i < b[!p]; i++) {
            for (int i = 0; i < sz; i++) cout << "B";
            cout << endl;
          }
          for (int i = 0; i < ss; i++) {
            for (int i = 0; i < a[!k[0]]; i++) cout << "A";
            for (int i = 0; i < c[!k[2]]; i++) cout << "C";
            cout << endl;
          }
          f = true;
        }
        if (kk == 2) {
          int ss = sz - c[!p];
          if (b[0] == ss) k[1] = 0;
          if (b[1] == ss) k[1] = 1;
          if (a[0] == ss) k[0] = 0;
          if (a[1] == ss) k[0] = 1;
          cout << sz << endl;
          for (int i = 0; i < c[!p]; i++) {
            for (int i = 0; i < sz; i++) cout << "C";
            cout << endl;
          }
          for (int i = 0; i < ss; i++) {
            for (int i = 0; i < a[!k[0]]; i++) cout << "A";
            for (int i = 0; i < b[!k[1]]; i++) cout << "B";
            cout << endl;
          }
          f = true;
        }
      } else {
        f = false;
      }
    }
    if (!f) cout << -1 << endl;
  }
  return 0;
}
