#include <bits/stdc++.h>
using namespace std;
void printlinear(int n, int x1, int x2, int x3) {
  int i;
  for (i = 0; i < x1; i++) {
    for (int j = 0; j < n; j++) {
      cout << 'A';
    }
    cout << endl;
  }
  for (i = 0; i < x2; i++) {
    for (int j = 0; j < n; j++) {
      cout << 'B';
    }
    cout << endl;
  }
  for (i = 0; i < x3; i++) {
    for (int j = 0; j < n; j++) {
      cout << 'C';
    }
    cout << endl;
  }
}
void print2(int n, int y1, int x2, int x3, int y2, char a, char b, char c) {
  for (int i = 0; i < y1; i++) {
    for (int j = 0; j < n; j++) {
      cout << a;
    }
    cout << endl;
  }
  for (int i = 0; i < y2; i++) {
    for (int j = 0; j < x2; j++) {
      cout << b;
    }
    for (int j = 0; j < x3; j++) {
      cout << c;
    }
    cout << endl;
  }
}
int main() {
  long long int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  long long int n, n_sqr = 0, sum = 0;
  long long param_1, param_2, param_3;
  bool case_1 = true, case_2 = false;
  n_sqr = x1 * y1 + x2 * y2 + x3 * y3;
  n = sqrt(n_sqr);
  if ((n * n != n_sqr) ||
      (x1 != n && y1 != n && x2 != n && y2 != n && x3 != n && y3 != n)) {
    cout << "-1\n";
    return 0;
  } else {
    sum = 0;
    if (x1 == n && y1 != n) {
      param_1 = y1;
      sum += y1;
    } else if (y1 == n && x1 != n) {
      param_1 = x1;
      sum += x1;
    } else
      case_1 = false;
    if (x2 == n && y2 != n) {
      param_2 = y2;
      sum += y2;
    } else if (y2 == n && x2 != n) {
      param_2 = x2;
      sum += x2;
    } else
      case_1 = false;
    if (x3 == n && y3 != n) {
      param_3 = y3;
      sum += y3;
    } else if (y3 == n && x3 != n) {
      param_3 = x3;
      sum += x3;
    } else
      case_1 = false;
    if (sum == n)
      case_1 = true;
    else
      case_1 = false;
  }
  if (case_1) {
    cout << n << "\n";
    printlinear(n, param_1, param_2, param_3);
    return 0;
  } else {
    case_2 = false;
    if (x1 == n) {
      if ((y2 == y3) && (y2 == n - y1) && (x2 + x3 == n)) {
        cout << n << "\n";
        print2(n, y1, x2, x3, y2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      } else if ((x2 == y3) && (x2 == n - y1) && (y2 + x3 == n)) {
        cout << n << "\n";
        print2(n, y1, y2, x3, x2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      } else if ((y2 == x3) && (y2 == n - y1) && (x2 + y3 == n)) {
        cout << n << "\n";
        print2(n, y1, x2, y3, y2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      } else if ((x2 == x3) && (x2 == n - y1) && (y2 + y3 == n)) {
        cout << n << "\n";
        print2(n, y1, y2, y3, x2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      }
    }
    if (y1 == n) {
      if ((y2 == y3) && (y2 == n - x1) && (x2 + x3 == n)) {
        cout << n << "\n";
        print2(n, x1, x2, x3, y2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      } else if ((x2 == y3) && (x2 == n - x1) && (y2 + x3 == n)) {
        cout << n << "\n";
        print2(n, x1, y2, x3, x2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      } else if ((y2 == x3) && (y2 == n - x1) && (x2 + y3 == n)) {
        cout << n << "\n";
        print2(n, x1, x2, y3, y2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      } else if ((x2 == x3) && (x2 == n - x1) && (y2 + y3 == n)) {
        cout << n << "\n";
        print2(n, x1, y2, y3, x2, 'A', 'B', 'C');
        return 0;
        case_2 = true;
      }
    }
    if (x2 == n) {
      if ((y1 == y3) && (y1 == n - y2) && (x1 + x3 == n)) {
        cout << n << "\n";
        print2(n, y2, x1, x3, y1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      } else if ((x1 == y3) && (x1 == n - y2) && (y1 + x3 == n)) {
        cout << n << "\n";
        print2(n, y2, y1, x3, x1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      } else if ((y1 == x3) && (y1 == n - y2) && (x1 + y3 == n)) {
        cout << n << "\n";
        print2(n, y2, x1, y3, y1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      } else if ((x1 == x3) && (x1 == n - y2) && (y1 + y3 == n)) {
        cout << n << "\n";
        print2(n, y2, y1, y3, x1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      }
    }
    if (y2 == n) {
      if ((y1 == y3) && (y1 == n - x2) && (x1 + x3 == n)) {
        cout << n << "\n";
        print2(n, x2, x1, x3, y1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      } else if ((x1 == y3) && (x1 == n - x2) && (y1 + x3 == n)) {
        cout << n << "\n";
        print2(n, x2, y1, x3, x1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      } else if ((y1 == x3) && (y1 == n - x2) && (x1 + y3 == n)) {
        cout << n << "\n";
        print2(n, x2, x1, y3, y1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      } else if ((x1 == x3) && (x1 == n - x2) && (y1 + y3 == n)) {
        cout << n << "\n";
        print2(n, x2, y1, y3, x1, 'B', 'A', 'C');
        return 0;
        case_2 = true;
      }
    }
    if (x3 == n) {
      if ((y2 == y1) && (y2 == n - y3) && (x2 + x1 == n)) {
        cout << n << "\n";
        print2(n, y3, x2, x1, y2, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      } else if ((x2 == y1) && (x2 == n - y3) && (y2 + x1 == n)) {
        cout << n << "\n";
        print2(n, y3, y2, x1, x2, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      } else if ((y2 == x1) && (y2 == n - y3) && (x2 + y1 == n)) {
        cout << n << "\n";
        print2(n, y3, x2, y1, x1, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      } else if ((x2 == x1) && (x2 == n - y3) && (y2 + y1 == n)) {
        cout << n << "\n";
        print2(n, y3, y2, y1, x2, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      }
    }
    if (y3 == n) {
      if ((y2 == y1) && (y2 == n - x3) && (x2 + x1 == n)) {
        cout << n << "\n";
        print2(n, x3, x2, x1, y2, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      } else if ((x2 == y1) && (x2 == n - x3) && (y2 + x1 == n)) {
        cout << n << "\n";
        print2(n, x3, y2, x1, x2, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      } else if ((y2 == x1) && (y2 == n - x3) && (x2 + y1 == n)) {
        cout << n << "\n";
        print2(n, x3, x2, y1, x1, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      } else if ((x2 == x1) && (x2 == n - x3) && (y2 + y1 == n)) {
        cout << n << "\n";
        print2(n, x3, y2, y1, x2, 'C', 'B', 'A');
        return 0;
        case_2 = true;
      }
    }
  }
  if (!case_2) {
    cout << "-1\n";
  }
  return 0;
}
