#include <bits/stdc++.h>
using namespace std;
struct pii {
  char C;
  int fi;
  int se;
};
char A[1000][1000];
void p(int L) {
  cout << L << endl;
  for (int i = 1; i <= L; ++i) {
    for (int j = 1; j <= L; ++j) {
      cout << A[i][j];
    }
    cout << endl;
  }
}
void prin1(pii a, pii b, pii c) {
  int L = a.se;
  for (int i = 1; i <= L; ++i) {
    for (int j = 1; j <= a.fi; ++j) {
      A[i][j] = a.C;
    }
  }
  for (int i = 1; i <= L; ++i) {
    for (int j = a.fi + 1; j <= a.fi + b.fi; ++j) {
      A[i][j] = b.C;
    }
  }
  for (int i = 1; i <= L; ++i) {
    for (int j = a.fi + b.fi + 1; j <= L; ++j) {
      A[i][j] = c.C;
    }
  }
  p(L);
}
void prin2(pii a, pii b, pii c) {
  int L = a.fi;
  for (int i = 1; i <= L; ++i) {
    for (int j = 1; j <= a.se; ++j) {
      A[j][i] = a.C;
    }
  }
  for (int i = 1; i <= L; ++i) {
    for (int j = a.se + 1; j <= a.se + b.se; ++j) {
      A[j][i] = b.C;
    }
  }
  for (int i = 1; i <= L; ++i) {
    for (int j = a.se + b.se + 1; j <= L; ++j) {
      A[j][i] = c.C;
    }
  }
  p(L);
}
void prin3(pii a, pii b, pii c) {
  int L = c.se;
  for (int i = 1; i <= a.fi; ++i) {
    for (int j = 1; j <= a.se; ++j) {
      A[i][j] = a.C;
    }
  }
  for (int i = 1; i <= b.fi; ++i) {
    for (int j = a.se + 1; j <= L; ++j) {
      A[i][j] = b.C;
    }
  }
  for (int i = a.fi + 1; i <= L; ++i) {
    for (int j = 1; j <= L; ++j) {
      A[i][j] = c.C;
    }
  }
  p(L);
}
void prin4(pii a, pii b, pii c) {
  int L = a.fi;
  for (int i = 1; i <= b.fi; ++i) {
    for (int j = a.se + 1; j <= L; ++j) {
      A[i][j] = b.C;
    }
  }
  for (int i = b.fi + 1; i <= L; ++i) {
    for (int j = a.se + 1; j <= L; ++j) {
      A[i][j] = c.C;
    }
  }
  for (int i = 1; i <= L; ++i) {
    for (int j = 1; j <= a.se; ++j) {
      A[i][j] = a.C;
    }
  }
  p(L);
}
bool check(pii a, pii b, pii c) {
  if (a.fi + b.fi + c.fi == a.se and a.se == b.se and b.se == c.se) {
    prin1(a, b, c);
    return 1;
  }
  if (a.fi == b.fi and b.fi == c.fi and a.fi == a.se + b.se + c.se) {
    prin2(a, b, c);
    return 1;
  }
  if (a.fi == b.fi + c.fi and a.fi == a.se + b.se and b.se == c.se) {
    prin4(a, b, c);
    return 1;
  }
  if (a.se + b.se == c.se and c.se == a.fi + c.fi and a.fi == b.fi) {
    prin3(a, b, c);
    return 1;
  }
  return 0;
}
int main() {
  vector<pii> temp;
  pii a, b, c;
  cin >> a.fi >> a.se;
  cin >> b.fi >> b.se;
  cin >> c.fi >> c.se;
  a.C = 'A';
  b.C = 'B';
  c.C = 'C';
  vector<int> g;
  g.push_back(0);
  g.push_back(1);
  g.push_back(2);
  for (int mask = 0; mask < 8; ++mask) {
    if (mask & (1 << 0)) swap(a.fi, a.se);
    if (mask & (1 << 1)) swap(b.fi, b.se);
    if (mask & (1 << 2)) swap(c.fi, c.se);
    temp.clear();
    sort(g.begin(), g.end());
    temp.push_back(a);
    temp.push_back(b);
    temp.push_back(c);
    do {
      if (check(temp[g[0]], temp[g[1]], temp[g[2]])) return 0;
    } while (next_permutation(g.begin(), g.end()));
    if (mask & (1 << 0)) swap(a.fi, a.se);
    if (mask & (1 << 1)) swap(b.fi, b.se);
    if (mask & (1 << 2)) swap(c.fi, c.se);
  }
  cout << -1;
}
