#include <bits/stdc++.h>
using namespace std;
const int N = 10005;
char A[N][N];
void F_Draw(char c, int lx, int rx, int ly, int ry) {
  for (int i = lx; i < rx; i++) {
    for (int j = ly; j < ry; j++) {
      A[i][j] = c;
    }
  }
}
struct Rectangle {
  Rectangle() {
    lx1 = -1;
    rx1 = -1;
    ly1 = -1;
    ry1 = -1;
  }
  int lx1;
  int rx1;
  int ly1;
  int ry1;
};
int sizeT;
Rectangle R1, R2;
void F_true(int Max0, int Min0, int Max1, int Min1, int Max2, int Min2,
            int Step) {
  if ((Max0 == Min1 + Min2) && (Max1 == Max2)) {
    R1.lx1 = Step;
    R1.rx1 = Max1 + Step;
    R1.ly1 = 0;
    R1.ry1 = Min1;
    R2.lx1 = Step;
    R2.rx1 = Max1 + Step;
    R2.ly1 = Min1;
    R2.ry1 = Max0;
  } else if ((Max0 == Max1 + Max2) && (Min1 == Min2)) {
    R1.lx1 = Step;
    R1.rx1 = Min1 + Step;
    R1.ly1 = 0;
    R1.ry1 = Max1;
    R2.lx1 = Step;
    R2.rx1 = Min1 + Step;
    R2.ly1 = Max1;
    R2.ry1 = Max0;
  } else if ((Max0 == Max1 + Min2) && (Min1 == Max2)) {
    R1.lx1 = Step;
    R1.rx1 = Min1 + Step;
    R1.ly1 = 0;
    R1.ry1 = Max1;
    R2.lx1 = Step;
    R2.rx1 = Min1 + Step;
    R2.ly1 = Max1;
    R2.ry1 = Max0;
  } else if ((Max0 == Min1 + Max2) && (Max1 == Min2)) {
    R1.lx1 = Step;
    R1.rx1 = Max1 + Step;
    R1.ly1 = 0;
    R1.ry1 = Min1;
    R2.lx1 = Step;
    R2.rx1 = Max1 + Step;
    R2.ly1 = Min1;
    R2.ry1 = Max0;
  }
}
int main() {
  int aw, ah, bw, bh, cw, ch;
  ifstream ff("file.txt");
  cin >> aw >> ah >> bw >> bh >> cw >> ch;
  int MaxA = max(aw, ah), MaxB = max(bw, bh), MaxC = max(cw, ch);
  int MinA = min(aw, ah), MinB = min(bw, bh), MinC = min(cw, ch);
  int PMax =
      (MaxA > MaxB ? (MaxA > MaxC ? MaxA : MaxC) : (MaxB > MaxC ? MaxB : MaxC));
  if (MaxA >= MaxB && MaxA >= MaxC) {
    sizeT += MinA;
    if (MaxA != MaxB || MaxA != MaxC) {
      F_true(MaxA, MinA, MaxB, MinB, MaxC, MinC, MinA);
      if (R1.lx1 == -1) {
        cout << -1 << endl;
        return 0;
      } else {
        F_Draw('A', 0, MinA, 0, MaxA);
        F_Draw('B', R1.lx1, R1.rx1, R1.ly1, R1.ry1);
        sizeT += R1.rx1 - R1.lx1;
        F_Draw('C', R2.lx1, R2.rx1, R2.ly1, R2.ry1);
      }
    } else {
      F_Draw('A', 0, MinA, 0, MaxA);
      F_Draw('B', sizeT, MinB + sizeT, 0, MaxB);
      sizeT += MinB;
      F_Draw('C', sizeT, MinC + sizeT, 0, MaxC);
      sizeT += MinC;
    }
  } else if (MaxB >= MaxA && MaxB >= MaxC) {
    F_true(MaxB, MinB, MaxA, MinA, MaxC, MinC, MinB);
    if (R1.lx1 == -1) {
      cout << -1 << endl;
      return 0;
    } else {
      sizeT += MinB;
      F_Draw('B', 0, MinB, 0, MaxB);
      F_Draw('A', R1.lx1, R1.rx1, R1.ly1, R1.ry1);
      sizeT += R1.rx1 - R1.lx1;
      F_Draw('C', R2.lx1, R2.rx1, R2.ly1, R2.ry1);
    }
  } else {
    F_true(MaxC, MinC, MaxA, MinA, MaxB, MinB, MinC);
    if (R1.lx1 == 0) {
      cout << -1 << endl;
      return 0;
    } else {
      sizeT += MinC;
      F_Draw('C', 0, MinC, 0, MaxC);
      F_Draw('A', R1.lx1, R1.rx1, R1.ly1, R1.ry1);
      sizeT += R1.rx1 - R1.lx1;
      F_Draw('B', R2.lx1, R2.rx1, R2.ly1, R2.ry1);
    }
  }
  if (sizeT != PMax) {
    cout << -1 << endl;
    return 0;
  }
  cout << sizeT << endl;
  for (int i = 0; i < sizeT; i++) {
    for (int j = 0; j < PMax; j++) {
      cout << A[i][j];
    }
    cout << endl;
  }
  return 0;
}
