#include <bits/stdc++.h>
using namespace std;
void set1(int n, int y, int x, char c1, char c2, char c3) {
  for (int i = 0; i < (y); i++) {
    for (int j = 0; j < (n); j++) {
      cout << c1;
    }
    cout << endl;
  }
  for (int i = 0; i < (n - y); i++) {
    for (int j = 0; j < (x); j++) {
      cout << c2;
    }
    for (int j = 0; j < (n - x); j++) {
      cout << c3;
    }
    cout << endl;
  }
}
void set2(int n, int y, int x, char c1, char c2, char c3) {
  for (int i = 0; i < (y); i++) {
    for (int j = 0; j < (x); j++) {
      cout << c2;
    }
    for (int j = 0; j < (n - x); j++) {
      cout << c1;
    }
    cout << endl;
  }
  for (int i = 0; i < (n - y); i++) {
    for (int j = 0; j < (x); j++) {
      cout << c3;
    }
    for (int j = 0; j < (n - x); j++) {
      cout << c1;
    }
    cout << endl;
  }
}
int possible(int a, int b, int c, int p, int q, int r) {
  if (a + b == c) {
    if (p == q) {
      if (q + r == (a + b + c) / 2) {
        int n = (a + b + c) / 2;
        cout << n << endl;
        set1(n, r, a, 'C', 'A', 'B');
        return 1;
      }
    }
  }
  if (a + c == b) {
    if (r == p) {
      if (q + r == (a + b + c) / 2) {
        int n = (a + b + c) / 2;
        cout << n << endl;
        set1(n, q, a, 'B', 'A', 'C');
        return 1;
      }
    }
  }
  if (b + c == a) {
    if (r == q) {
      if (q + p == (a + b + c) / 2) {
        int n = (a + b + c) / 2;
        cout << n << endl;
        set1(n, p, b, 'A', 'B', 'C');
        return 1;
      }
    }
  }
  if (p + q == r) {
    if (a == b) {
      if (b + c == r) {
        int n = r;
        cout << n << endl;
        set2(n, q, b, 'C', 'B', 'A');
        return 1;
      }
    }
  }
  if (r + q == p) {
    if (c == b) {
      if (a + c == p) {
        int n = p;
        cout << n << endl;
        set2(n, q, b, 'A', 'B', 'C');
        return 1;
      }
    }
  }
  if (p + r == q) {
    if (a == c) {
      if (b + c == q) {
        int n = q;
        cout << n << endl;
        set2(n, p, a, 'B', 'A', 'C');
        return 1;
      }
    }
  }
  if (a == b && b == c && a == p + q + r) {
    cout << a << endl;
    for (int i = 0; i < (p); i++) {
      for (int j = 0; j < (a); j++) {
        cout << "A";
      }
      cout << endl;
    }
    for (int i = 0; i < (q); i++) {
      for (int j = 0; j < (a); j++) {
        cout << "B";
      }
      cout << endl;
    }
    for (int i = 0; i < (r); i++) {
      for (int j = 0; j < (a); j++) {
        cout << "C";
      }
      cout << endl;
    }
    return 1;
  }
  if (p == q && q == r && p == a + b + c) {
    cout << p << endl;
    for (int i = 0; i < (p); i++) {
      for (int j = 0; j < (a); j++) {
        cout << "A";
      }
      for (int j = 0; j < (b); j++) {
        cout << "B";
      }
      for (int j = 0; j < (c); j++) {
        cout << "C";
      }
      cout << endl;
    }
    return 1;
  }
  return 0;
}
int main() {
  int a, b, c, p, q, r;
  cin >> a >> p >> b >> q >> c >> r;
  if (!possible(a, b, c, p, q, r) && !possible(a, q, c, p, b, r) &&
      !possible(a, b, r, p, q, c) && !possible(a, q, r, p, b, c)) {
    cout << "-1" << endl;
  }
}
