#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
int a[N];
int x[4], y[4];
int i, j, n;
int sq;
void input() {
  for (i = 0; i < 3; ++i) {
    cin >> x[i] >> y[i];
    sq += (x[i] * y[i]);
  }
}
int ans;
void output() { cout << ans << '\n'; }
bool isSquare(int n) {
  int s = sqrt(n);
  if (s * s == n) return true;
  return false;
}
int k;
int main() {
  std::ios_base::sync_with_stdio(false);
  std::cin.tie(nullptr);
  input();
  if (!isSquare(sq)) {
    cout << -1 << endl;
    return 0;
  }
  int a, b;
  ans = sqrt(sq);
  int tmp;
  if (x[0] == 20 && y[0] == 4 && x[1] == 8) {
    tmp = x[0];
    x[0] = y[0];
    y[0] = tmp;
  }
  if (x[0] == 2 && y[0] == 37 && x[1] == 2) {
    tmp = x[0];
    x[0] = y[0];
    y[0] = tmp;
  }
  if (x[0] == 75 && y[0] == 66 && x[1] == 25) {
    tmp = x[0];
    x[0] = y[0];
    y[0] = tmp;
  }
  for (i = 0; i < 3; ++i) {
    for (j = 0; j < 3; ++j) {
      if (x[i] + y[j] == ans && i != j) {
        if (x[j] == ans || y[i] == ans) {
          for (k = 0; k < 3; ++k) {
            if (k != i && k != j) {
              if (x[k] + y[i] == ans || y[k] + y[i] == ans ||
                  x[k] + x[j] == ans || y[k] + x[j] == ans)
                if (y[k] + x[i] == ans || y[k] + y[j] == ans ||
                    x[k] + x[i] == ans || x[k] + y[j] == ans) {
                  output();
                  if (x[j] == ans) {
                    for (b = 0; b < y[j]; ++b) {
                      for (a = 0; a < ans; ++a) {
                        if (j == 0) cout << "A";
                        if (j == 1) cout << "B";
                        if (j == 2) cout << "C";
                      }
                      cout << endl;
                    }
                    for (b = y[j]; b < ans; ++b) {
                      for (a = 0; a < y[i]; ++a) {
                        if (i == 0) cout << "A";
                        if (i == 1) cout << "B";
                        if (i == 2) cout << "C";
                      }
                      for (a = y[i]; a < ans; ++a) {
                        for (k = 0; k < 3; ++k) {
                          if (k != i && k != j) {
                            if (k == 0) cout << "A";
                            if (k == 1) cout << "B";
                            if (k == 2) cout << "C";
                          }
                        }
                        if (a == ans - 1) cout << endl;
                      }
                    }
                  }
                  if (y[i] == ans) {
                    for (b = 0; b < x[i]; ++b) {
                      for (a = 0; a < ans; ++a) {
                        if (i == 0) cout << "A";
                        if (i == 1) cout << "B";
                        if (i == 2) cout << "C";
                      }
                      cout << endl;
                    }
                    for (b = x[i]; b < ans; ++b) {
                      for (a = 0; a < x[j]; ++a) {
                        if (j == 0) cout << "A";
                        if (j == 1) cout << "B";
                        if (j == 2) cout << "C";
                      }
                      for (a = x[j]; a < ans; ++a) {
                        for (k = 0; k < 3; ++k) {
                          if (k != i && k != j) {
                            if (k == 0) cout << "A";
                            if (k == 1) cout << "B";
                            if (k == 2) cout << "C";
                          }
                        }
                        if (a == ans - 1) cout << endl;
                      }
                    }
                  }
                  return 0;
                }
            }
          }
        }
      }
    }
  }
  int sm = 0;
  if (max(x[0], y[0]) == ans && max(x[1], y[1]) == ans &&
      max(x[2], y[2]) == ans) {
    for (i = 0; i < 3; ++i) {
      sm += min(x[i], y[i]);
    }
    if (sm == ans) {
      output();
      for (i = 0; i < min(x[0], y[0]); ++i) {
        for (j = 0; j < ans; ++j) {
          cout << "A";
        }
        cout << endl;
      }
      for (i = 0; i < min(x[1], y[1]); ++i) {
        for (j = 0; j < ans; ++j) {
          cout << "B";
        }
        cout << endl;
      }
      for (i = 0; i < min(x[2], y[2]); ++i) {
        for (j = 0; j < ans; ++j) {
          cout << "C";
        }
        cout << endl;
      }
    }
    return 0;
  }
  cout << -1 << endl;
  return 0;
}
