#include <bits/stdc++.h>
using namespace std;
const int INF = 1000000000;
const int mod = 1000000007;
const double eps = 0.0000000001;
int n, m;
vector<vector<char> > board;
bool Try(int x1, int y1, int x2, int y2, int x3, int y3) {
  if (x1 != n && y1 != n && x2 != n && y2 != n && x3 != n && y3 != n)
    return false;
  if (x1 > n || y1 > n || x2 > n || y2 > n || x3 > n || y3 > n) return false;
  board.resize(n + 1);
  for (int i = 0; i <= n; i++) {
    board[i].resize(n + 1, '#');
  }
  if (x2 == n || y2 == n) {
    swap(x1, x2);
    swap(y1, y2);
  }
  if (x3 == n || y3 == n) {
    swap(x1, x3);
    swap(y1, y3);
  }
  if (x1 != n) {
    swap(x1, y1);
  }
  m -= y1;
  for (int i = 1; i <= y1; i++) {
    for (int j = 1; j <= n; j++) {
      board[i][j] = '1';
    }
  }
  if (x2 < y2) {
    swap(x2, y2);
  }
  if (x3 < y3) {
    swap(x3, y3);
  }
  if (x2 == n && x3 == n) {
    if (y2 + y3 != m) return false;
    for (int i = y1 + 1; i <= y1 + y2; i++) {
      for (int j = 1; j <= n; j++) {
        board[i][j] = '2';
      }
    }
    for (int i = y1 + y2 + 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        board[i][j] = '3';
      }
    }
    return true;
  }
  if (x2 == m && x3 == m) {
    if (y2 + y3 == n) {
      for (int i = y1 + 1; i <= n; i++) {
        for (int j = 1; j <= y2; j++) {
          board[i][j] = '2';
        }
      }
      for (int i = y1 + 1; i <= n; i++) {
        for (int j = y2 + 1; j <= n; j++) {
          board[i][j] = '3';
        }
      }
      return true;
    }
  }
  if (y2 == m && y3 == m) {
    if (x2 + x3 != n) return false;
    swap(x2, y2);
    swap(x3, y3);
    for (int i = y1 + 1; i <= n; i++) {
      for (int j = 1; j <= y2; j++) {
        board[i][j] = '2';
      }
    }
    for (int i = y1 + 1; i <= n; i++) {
      for (int j = y2 + 1; j <= n; j++) {
        board[i][j] = '3';
      }
    }
    return true;
  }
  if (x3 > y3) {
    swap(x3, y3);
  }
  if (x2 == n && x3 == n) {
    if (y2 + y3 != m) return false;
    for (int i = y1 + 1; i <= y1 + y2; i++) {
      for (int j = 1; j <= n; j++) {
        board[i][j] = '2';
      }
    }
    for (int i = y1 + y2 + 1; i <= n; i++) {
      for (int j = 1; j <= n; j++) {
        board[i][j] = '3';
      }
    }
    return true;
  }
  if (x2 == m && x3 == m) {
    if (y2 + y3 == n) {
      for (int i = y1 + 1; i <= n; i++) {
        for (int j = 1; j <= y2; j++) {
          board[i][j] = '2';
        }
      }
      for (int i = y1 + 1; i <= n; i++) {
        for (int j = y2 + 1; j <= n; j++) {
          board[i][j] = '3';
        }
      }
      return true;
    }
  }
  if (y2 == m && y3 == m) {
    if (x2 + x3 != n) return false;
    swap(x2, y2);
    swap(x3, y3);
    for (int i = y1 + 1; i <= n; i++) {
      for (int j = 1; j <= y2; j++) {
        board[i][j] = '2';
      }
    }
    for (int i = y1 + 1; i <= n; i++) {
      for (int j = y2 + 1; j <= n; j++) {
        board[i][j] = '3';
      }
    }
    return true;
  }
  return false;
}
void solution() {
  vector<pair<int, int> > sizes(3);
  int x, y;
  int square = 0;
  for (int i = 0; i < 3; i++) {
    cin >> x >> y;
    if (x < y) swap(x, y);
    square += (x * y);
    sizes[i] = make_pair(x, y);
  }
  n = -1;
  for (int i = 0; i <= 500; i++) {
    if (i * i == square) {
      n = i;
      break;
    }
  }
  if (n == -1) {
    cout << "-1\n";
    return;
  }
  m = n;
  bool ok = Try(sizes[0].first, sizes[0].second, sizes[1].first,
                sizes[1].second, sizes[2].first, sizes[2].second);
  if (!ok) {
    cout << "-1\n";
    return;
  }
  cout << n << "\n";
  int ones = 0, twos = 0, thirds = 0;
  int side_ones = 0, side_twos = 0, side_thirds = 0;
  int side_ones_2, side_twos_2, side_thirds_2;
  int k1, k2, k3;
  k1 = 0, k2 = 0, k3 = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      if (board[i][j] == '1') ones++;
      if (board[i][j] == '2') twos++;
      if (board[i][j] == '3') thirds++;
      if (board[i][j] == '1') {
        k1++;
      } else {
        k1 = min(k1, n);
        if (k1 != 0) {
          side_ones = max(side_ones, k1);
          k1 = 0;
        }
      }
      if (board[i][j] == '2') {
        k2++;
      } else {
        k2 = min(k2, n);
        if (k2 != 0) {
          side_twos = max(side_twos, k2);
          k2 = 0;
        }
      }
      if (board[i][j] == '3') {
        k3++;
      } else {
        k3 = min(k3, n);
        if (k3 != 0) {
          side_thirds = max(side_thirds, k3);
          k3 = 0;
        }
      }
    }
  }
  side_ones = max(side_ones, min(k1, n));
  side_twos = max(side_twos, min(k2, n));
  side_thirds = max(side_thirds, min(k3, n));
  side_ones_2 = ones / side_ones;
  side_twos_2 = twos / side_twos;
  side_thirds_2 = thirds / side_thirds;
  map<char, char> go;
  vector<bool> was(3, false);
  if (side_ones < side_ones_2) swap(side_ones, side_ones_2);
  if (side_twos < side_twos_2) swap(side_twos, side_twos_2);
  if (side_thirds < side_thirds_2) swap(side_thirds, side_thirds_2);
  for (int i = 0; i < 3; i++) {
    if (!was[0] && make_pair(side_ones, side_ones_2) == sizes[i]) {
      go['1'] = char('A' + i);
      was[0] = true;
    } else if (!was[1] && make_pair(side_twos, side_twos_2) == sizes[i]) {
      go['2'] = char('A' + i);
      was[1] = true;
    } else {
      go['3'] = char('A' + i);
      was[2] = true;
    }
  }
  int Aa = 0, Bb = 0, Cc = 0;
  for (int i = 1; i <= n; i++) {
    for (int j = 1; j <= n; j++) {
      cout << go[board[i][j]];
      if (go[board[i][j]] == 'A') Aa = 1;
      if (go[board[i][j]] == 'B') Bb = 1;
      if (go[board[i][j]] == 'C') Cc = 1;
    }
    cout << "\n";
  }
}
void include_file() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
int main() {
  solution();
  return 0;
}
