#include <bits/stdc++.h>
using namespace std;
bool issquare(int f1, int f2, int s1, int s2, int t1, int t2,
              vector<string>& res) {
  int cul = f1 + s1;
  int reqw = max(f2, s2) - min(f2, s2);
  int reql;
  if (f2 == s2) {
    if (t2 == f2 && (f2 == t1 + s1 + f1)) {
      for (int i = 0; i < f1 + s1 + t1; ++i) {
        string s;
        if (i < f1) {
          string t(f2, 'A');
          s = t;
        } else if (i < f1 + s1) {
          string t(f2, 'B');
          s = t;
        } else {
          string t(f2, 'C');
          s = t;
        }
        res.push_back(s);
      }
      return true;
    } else if (f1 + s1 == t1 && f1 + s1 == f2 + t2) {
      for (int i = 0; i < f1 + s1; ++i) {
        string s;
        if (i < f1) {
          string t11(f2, 'A');
          string t12(t2, 'C');
          s = t11 + t12;
        } else {
          string t11(f2, 'B');
          string t12(t2, 'C');
          s = t11 + t12;
        }
        res.push_back(s);
      }
      return true;
    }
  } else if (f2 > s2) {
    reql = s1;
    if (((t1 == reql && t2 == reqw) || (t1 == reqw && t2 == reql)) &&
        (f1 + s1 == f2)) {
      string s = "";
      for (int i = 0; i < f1 + s1; ++i) {
        if (i < f1) {
          string t11(f2, 'A');
          s = t11;
        } else {
          string t11(s2, 'B');
          string t21(reqw, 'C');
          s = t11 + t21;
        }
        res.push_back(s);
      }
      return true;
    }
  } else {
    reql = f1;
    if (((t1 == reql && t2 == reqw) || (t1 == reqw && t2 == reql)) &&
        (f1 + s1 == s2)) {
      string s = "";
      for (int i = 0; i < f1 + s1; ++i) {
        if (i < f1) {
          string t11(f2, 'A');
          string t21(reqw, 'C');
          s = t11 + t21;
        } else {
          string t11(s2, 'B');
          s = t11;
        }
        res.push_back(s);
      }
      return true;
    }
  }
  int cuw = f2 + s2;
  reql = max(f1, s1) - min(f1, s1);
  if (f1 == s1) {
    if (t1 == s1 && (f2 + s2 + t2 == f1)) {
      for (int i = 0; i < f1; ++i) {
        string t11(f2, 'A');
        string t21(s2, 'B');
        string t31(t2, 'C');
        res.push_back(t11 + t21 + t31);
      }
      return true;
    } else if (f2 + s2 == t2 && f1 + t1 == t2) {
      for (int i = 0; i < f1 + t1; ++i) {
        string s;
        if (i < f1) {
          string t11(f2, 'A');
          string t12(s2, 'B');
          s = t11 + t12;
        } else {
          string t11(t2, 'C');
          s = t11;
        }
        res.push_back(s);
      }
      return true;
    }
  } else if (f1 > s1) {
    reqw = s2;
    if (((t1 == reql && t2 == reqw) || (t1 == reqw && t2 == reql)) &&
        (f1 == f2 + s2)) {
      string s = "";
      for (int i = 0; i < f1; ++i) {
        if (i < s1) {
          string t11(f2, 'A');
          string t21(s2, 'B');
          s = t11 + t21;
        } else {
          string t11(f2, 'A');
          string t21(s2, 'C');
          s = t11 + t21;
        }
        res.push_back(s);
      }
      return true;
    }
  } else {
    reqw = f2;
    if (((t1 == reql && t2 == reqw) || (t1 == reqw && t2 == reql)) &&
        (s1 == s2 + f2)) {
      string s = "";
      for (int i = 0; i < s1; ++i) {
        if (i < f1) {
          string t11(f2, 'A');
          string t21(s2, 'B');
          s = t11 + t21;
        } else {
          string t11(f2, 'C');
          string t21(s2, 'B');
          s = t11 + t21;
        }
        res.push_back(s);
      }
      return true;
    }
  }
  return false;
}
int main() {
  int f1, f2, s1, s2, t1, t2;
  cin >> f1 >> f2 >> s1 >> s2 >> t1 >> t2;
  vector<string> res;
  if (issquare(f1, f2, s1, s2, t1, t2, res) ||
      issquare(f1, f2, s1, s2, t2, t1, res) ||
      issquare(f1, f2, s2, s1, t1, t2, res) ||
      issquare(f1, f2, s2, s1, t2, t1, res) ||
      issquare(f2, f1, s1, s2, t1, t2, res) ||
      issquare(f2, f1, s1, s2, t2, t1, res) ||
      issquare(f2, f1, s2, s1, t1, t2, res) ||
      issquare(f2, f1, s2, s1, t2, t1, res)) {
    cout << res.size() << endl;
    for (int i = 0; i < res.size(); ++i) {
      cout << res[i] << endl;
    }
  } else {
    cout << "-1" << endl;
  }
}
