#include <bits/stdc++.h>
using ll = long long;
using namespace std;
array<int, 2> shapes[3];
bool placed[3];
array<char, 3> char_for_pos = {'A', 'B', 'C'};
char mat[400][400];
bool valid_new_point(int i, int j) {
  if (i < 0 || j < 0 || i >= 400 || j >= 400) {
    return false;
  }
  return mat[i][j] == '0';
}
void print_sq(int k) {
  for (int i = 0; i < k; ++i) {
    for (int abc = 0; abc < k; ++abc) {
      cout << mat[i][abc] << " ";
    }
    cout << endl;
    ;
  }
}
void place(char c, int i, int j, int length, int width) {
  for (int a = i; a < i + length; ++a) {
    for (int b = j; b < j + width; ++b) {
      mat[a][b] = c;
    }
  }
}
struct rectangle {
  int x1;
  int y1;
  int x2;
  int y2;
  int length;
  int width;
};
int backtrack(array<int, 2> place_at, rectangle* prev_rect, int num_placed,
              int exp_len, int exp_width) {
  for (int i = 0; i < 3; ++i) {
    if (placed[i]) {
      continue;
    }
    placed[i] = true;
    int length = shapes[i][0];
    int width = shapes[i][1];
    for (int flip = 0; flip < 2; ++flip) {
      if (flip) {
        swap(length, width);
      }
      rectangle rect{
          place_at[0],
          place_at[1],
          place_at[0] + length - 1,
          place_at[1] + width - 1,
          length,
          width,
      };
      int solved = 0;
      if (num_placed == 0) {
        solved =
            backtrack({rect.x2 + 1, rect.y1}, &rect, num_placed + 1, -1, -1);
        if (solved <= 0) {
          solved =
              backtrack({rect.x1, rect.y2 + 1}, &rect, num_placed + 1, -1, -1);
        }
      } else if (num_placed == 1) {
        if (rect.x1 > prev_rect->x1) {
          if (rect.width == prev_rect->width) {
            solved = backtrack(
                {rect.x2 + 1, rect.y1}, prev_rect, num_placed + 1,
                rect.width - (rect.length + prev_rect->length), rect.width);
            if (solved <= 0) {
              solved =
                  backtrack({prev_rect->x1, prev_rect->y2 + 1}, prev_rect,
                            num_placed + 1, rect.length + prev_rect->length,
                            (rect.length + prev_rect->length) - rect.width);
            }
          } else if (rect.width > prev_rect->width) {
            if (rect.width == prev_rect->length + rect.length) {
              solved = backtrack({prev_rect->x1, prev_rect->y2 + 1}, prev_rect,
                                 num_placed + 1, prev_rect->length,
                                 rect.width - prev_rect->width);
            }
          } else if (rect.width < prev_rect->width) {
            if (prev_rect->width == rect.length + prev_rect->length) {
              solved =
                  backtrack({rect.x1, rect.y2 + 1}, prev_rect, num_placed + 1,
                            rect.length, prev_rect->width - rect.width);
            }
          }
        } else if (rect.x1 == prev_rect->x1) {
          if (rect.length == prev_rect->length) {
            solved = backtrack({rect.x1, rect.y2 + 1}, prev_rect,
                               num_placed + 1, rect.length,
                               rect.length - (rect.width + prev_rect->width));
            if (solved <= 0) {
              backtrack({prev_rect->length, prev_rect->y1}, prev_rect,
                        num_placed + 1,
                        rect.width + prev_rect->width - prev_rect->length,
                        rect.width + prev_rect->width);
            }
          } else if (rect.length > prev_rect->length) {
            if (rect.length == prev_rect->width + rect.width) {
              solved = backtrack(
                  {prev_rect->length, prev_rect->y1}, prev_rect, num_placed + 1,
                  rect.length - prev_rect->length, prev_rect->width);
            }
          } else if (rect.length < prev_rect->length) {
            if (prev_rect->length == rect.width + prev_rect->width) {
              solved =
                  backtrack({rect.length, rect.y1}, prev_rect, num_placed + 1,
                            prev_rect->length - rect.length, rect.width);
            }
          }
        } else {
          assert(false);
        }
      } else {
        if (exp_len != rect.length || exp_width != rect.width) {
          continue;
        }
        solved = max(rect.x2 + 1, rect.y2 + 1);
      }
      if (solved > 0) {
        place(char_for_pos[i], rect.x1, rect.y1, rect.length, rect.width);
        return solved;
      }
    }
    placed[i] = false;
  }
  return 0;
}
int main() {
  for (int i = 0; i < 3; ++i) {
    cin >> shapes[i][0] >> shapes[i][1];
    placed[i] = false;
  }
  for (int i = 0; i < 400; ++i) {
    for (int j = 0; j < 400; ++j) {
      mat[i][j] = '0';
    }
  }
  int len = backtrack({0, 0}, nullptr, 0, -1, -1);
  if (len <= 0) {
    cout << -1 << endl;
    exit(0);
  }
  cout << len << endl;
  for (int i = 0; i < len; ++i) {
    for (int j = 0; j < len; ++j) {
      cout << mat[i][j];
    }
    cout << endl;
  }
}
