#include <bits/stdc++.h>
using namespace std;
int arr1[2];
int arr2[2];
int arr3[2];
int main() {
  int x1, y1, x2, y2, x3, y3;
  cin >> arr1[0] >> arr1[1] >> arr2[0] >> arr2[1] >> arr3[0] >> arr3[1];
  sort(arr1, arr1 + 2);
  sort(arr2, arr2 + 2);
  sort(arr3, arr3 + 2);
  swap(arr1[0], arr1[1]);
  swap(arr2[0], arr2[1]);
  swap(arr3[0], arr3[1]);
  int area = arr1[0] * arr1[1] + arr2[0] * arr2[1] + arr3[0] * arr3[1];
  int len = sqrt(area);
  if (len * len != area) {
    cout << "-1" << endl;
    return 0;
  }
  if (arr1[0] > len || arr2[0] > len || arr3[0] > len || arr1[1] > len ||
      arr2[1] > len || arr3[1] > len) {
    cout << "-1" << endl;
    return 0;
  }
  if (arr1[0] == len && arr2[0] == len && arr3[0] == len) {
    if (arr1[1] + arr2[1] + arr3[1] == len) {
      cout << len << endl;
      for (int i = 0; i < arr1[1]; i++) {
        for (int j = 0; j < len; j++) cout << "A";
        cout << endl;
      }
      for (int i = arr1[1]; i < arr1[1] + arr2[1]; i++) {
        for (int j = 0; j < len; j++) cout << "B";
        cout << endl;
      }
      for (int i = arr1[1] + arr2[1]; i < len; i++) {
        for (int j = 0; j < len; j++) cout << "C";
        cout << endl;
      }
      return 0;
    } else {
      cout << "-1" << endl;
      return 0;
    }
  }
  if (arr1[0] == len && arr2[0] == len) {
    cout << "-1" << endl;
    return 0;
  }
  if (arr1[0] == len && arr3[0] == len) {
    cout << "-1" << endl;
    return 0;
  }
  if (arr2[0] == len && arr3[0] == len) {
    cout << "-1" << endl;
    return 0;
  }
  if (arr1[0] == len) {
    int x1, y1, y2;
    int x = len - arr1[1];
    if (arr2[0] == x && arr3[0] == x && (arr2[1] + arr3[1]) == len) {
      x1 = arr2[0];
      y1 = arr2[1];
      y2 = arr3[1];
    } else if (arr2[0] == x && arr3[1] == x && (arr2[1] + arr3[0]) == len) {
      x1 = arr2[0];
      y1 = arr2[1];
      y2 = arr3[0];
    } else if (arr2[1] && arr3[0] == x && (arr2[0] + arr3[1]) == len) {
      x1 = arr2[1];
      y1 = arr2[0];
      y2 = arr3[1];
    } else if (arr2[1] && arr3[1] == x && (arr2[0] + arr3[0]) == len) {
      x1 = arr2[1];
      y1 = arr2[0];
      y2 = arr3[0];
    } else {
      cout << "-1" << endl;
      return 0;
    }
    cout << len << endl;
    for (int i = 0; i < arr1[1]; i++) {
      for (int j = 0; j < len; j++) cout << "A";
      cout << endl;
    }
    for (int i = arr1[1]; i < len; i++) {
      for (int j = 0; j < y1; j++) cout << "B";
      for (int j = y1; j < y1 + y2; j++) cout << "C";
      cout << endl;
    }
    return 0;
  } else if (arr2[0] == len) {
    int x1, y1, y2;
    int x = len - arr2[1];
    if (arr1[0] == x && arr3[0] == x && (arr1[1] + arr3[1]) == len) {
      x1 = arr1[0];
      y1 = arr1[1];
      y2 = arr3[1];
    } else if (arr1[0] == x && arr3[1] == x && (arr1[1] + arr3[0]) == len) {
      x1 = arr1[0];
      y1 = arr1[1];
      y2 = arr3[0];
    } else if (arr1[1] && arr3[0] == x && (arr1[0] + arr3[1]) == len) {
      x1 = arr1[1];
      y1 = arr1[0];
      y2 = arr3[1];
    } else if (arr1[1] && arr3[1] == x && (arr1[0] + arr3[0]) == len) {
      x1 = arr1[1];
      y1 = arr1[0];
      y2 = arr3[0];
    } else {
      cout << "-1" << endl;
      return 0;
    }
    cout << len << endl;
    for (int i = 0; i < arr2[1]; i++) {
      for (int j = 0; j < len; j++) cout << "B";
      cout << endl;
    }
    for (int i = arr2[1]; i < len; i++) {
      for (int j = 0; j < y1; j++) cout << "A";
      for (int j = y1; j < y1 + y2; j++) cout << "C";
      cout << endl;
    }
    return 0;
  }
  if (arr3[0] == len) {
    int x = len - arr3[1];
    int x1, y1, y2;
    if (arr2[0] == x && arr1[0] == x && (arr2[1] + arr1[1]) == len) {
      x1 = arr2[0];
      y1 = arr2[1];
      y2 = arr1[1];
    } else if (arr2[0] == x && arr1[1] == x && (arr2[1] + arr1[0]) == len) {
      x1 = arr2[0];
      y1 = arr2[1];
      y2 = arr1[0];
    } else if (arr2[1] && arr1[0] == x && (arr2[0] + arr1[1]) == len) {
      x1 = arr2[1];
      y1 = arr2[0];
      y2 = arr1[1];
    } else if (arr2[1] && arr1[1] == x && (arr2[0] + arr1[0]) == len) {
      x1 = arr2[1];
      y1 = arr2[0];
      y2 = arr1[0];
    } else {
      cout << "-1" << endl;
      return 0;
    }
    cout << len << endl;
    for (int i = 0; i < arr3[1]; i++) {
      for (int j = 0; j < len; j++) cout << "C";
      cout << endl;
    }
    for (int i = arr3[1]; i < len; i++) {
      for (int j = 0; j < y1; j++) cout << "B";
      for (int j = y1; j < y1 + y2; j++) cout << "A";
      cout << endl;
    }
    return 0;
  }
  cout << "-1" << endl;
}
