#include <bits/stdc++.h>
using namespace std;
int x[3], y[3];
char ch[3] = {'A', 'B', 'C'};
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  for (int i = 0; i < (3); i++) cin >> x[i] >> y[i];
  for (int a = 0; a < (16); a++) {
    for (int b = 0; b < (16); b++) {
      for (int c = 0; c < (16); c++) {
        for (int d = 0; d < (3); d++) {
          pair<int, int> top = make_pair(x[d], y[d]);
          vector<pair<int, int> > und;
          for (int i = 0; i < (3); i++)
            if (i != d) und.push_back(make_pair(x[i], y[i]));
          if (top.first != und[0].first + und[1].first) continue;
          if (und[0].second != und[1].second) continue;
          if (top.first != top.second + und[0].second) continue;
          cout << top.first << endl;
          int n = top.first;
          for (int i = 0; i < (n); i++) {
            for (int j = 0; j < (n); j++) {
              if (i < top.second)
                cout << ch[d];
              else if (j < und[0].first) {
                int tar = 0;
                if (d == 0) tar = 1;
                cout << ch[tar];
              } else {
                int tar = 0;
                if (d == 0) tar = 2;
                if (d == 1) tar = 2;
                if (d == 2) tar = 1;
                cout << ch[tar];
              }
            }
            cout << endl;
          }
          return 0;
        }
        for (int d = 0; d < (3); d++) {
          pair<int, int> top = make_pair(x[d], y[d]);
          vector<pair<int, int> > und;
          for (int i = 0; i < (3); i++)
            if (i != d) und.push_back(make_pair(x[i], y[i]));
          if (top.first != und[0].first) continue;
          if (top.first != und[1].first) continue;
          if (top.first != top.second + und[0].second + und[1].second) continue;
          cout << top.first << endl;
          int n = top.first;
          for (int i = 0; i < (n); i++) {
            for (int j = 0; j < (n); j++) {
              if (i < top.second)
                cout << ch[d];
              else if (i < top.second + und[0].second) {
                int tar = 0;
                if (d == 0) tar = 1;
                cout << ch[tar];
              } else {
                int tar = 0;
                if (d == 0) tar = 2;
                if (d == 1) tar = 2;
                if (d == 2) tar = 1;
                cout << ch[tar];
              }
            }
            cout << endl;
          }
          return 0;
        }
        swap(x[2], y[2]);
      }
      swap(x[1], y[1]);
    }
    swap(x[0], y[0]);
  }
  cout << -1 << endl;
}
