#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef map<ll,ll>::iterator mapit;
typedef set<int>::iterator setit;
const int maxn = 100+4;
const ll inf=1e18;
const int mod=1e9+7;
int x[3] , y[3];
char c[3];
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.precision(20);cout.tie(0);
cin >> x[0] >> y[0] >> x[1] >> y[1] >> x[2] >> y[2];
int s = x[0] * y[0] + x[1] * y[1] + x[2] * y[2];
c[0] = 'A' , c[1] = 'B' , c[2] = 'C';
int l = sqrt(s);
if(l * l !=s)
{
cout << -1;
return 0;
}
for(int i=0;i<3;i++)
if(x[i] > l || y[i] > l)
{
cout << -1;
return 0;
}
vector<int> v;
for(int i=0;i<3;i++)
{
if(y[i] == l)
swap(x[i],y[i]);
if(x[i] == l)
v.pb(i);
}
if(v.size() == 3)
{
cout << l << endl;
for(int i=0;i<3;i++)
{
for(int j=0;j<y[i];j++)
{
for(int k=0;k<l;k++)
cout << c[i] ;
cout << endl;
}
}
return 0;
}
if(v.size() == 1)
{
int cur = y[v[0]];
int le = l - cur;
int co = 0;
for(int i=0;i<3;i++)
{
if(i != v[0])
{
if(y[i] == le)
swap(x[i] , y[i]);
if(x[i] == le)
co ++;
}
}
if(co == 2)
{
cout << l << endl;
for(int i=0;i<cur;i++)
{
for(int j=0;j<l;j++)
cout << c[v[0]];
cout << endl;
}
int o1 = (v[0] + 1) % 3;
int o2 = (o1 + 1) % 3;
for(int i=0;i<le;i++)
{
for(int j=0;j<y[o1];j++)
cout << c[o1];
for(int j=0;j<y[o2];j++)
cout << c[o2];
cout << endl;
}
return 0;
}
}
cout << -1 ;
return 0;
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbXAgbWFrZV9wYWlyCiNkZWZpbmUgcGIgcHVzaF9iYWNrCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CnR5cGVkZWYgbG9uZyBsb25nIGxsOwp0eXBlZGVmIHBhaXI8aW50LGludD4gcGlpOwp0eXBlZGVmIHBhaXI8bGwsbGw+IHBsbDsKdHlwZWRlZiBsb25nIGRvdWJsZSBsZDsKdHlwZWRlZiBtYXA8bGwsbGw+OjppdGVyYXRvciBtYXBpdDsKdHlwZWRlZiBzZXQ8aW50Pjo6aXRlcmF0b3Igc2V0aXQ7CmNvbnN0IGludCBtYXhuID0gMTAwKzQ7CmNvbnN0IGxsIGluZj0xZTE4Owpjb25zdCBpbnQgbW9kPTFlOSs3OwppbnQgeFszXSAsIHlbM107CmNoYXIgY1szXTsKaW50IG1haW4oKQp7CiAgICBpb3NfYmFzZTo6c3luY193aXRoX3N0ZGlvKDApO2Npbi50aWUoMCk7Y291dC5wcmVjaXNpb24oMjApO2NvdXQudGllKDApOwogICAgY2luID4+IHhbMF0gPj4geVswXSA+PiB4WzFdID4+IHlbMV0gPj4geFsyXSA+PiB5WzJdOwogICAgaW50IHMgPSB4WzBdICogeVswXSArIHhbMV0gKiB5WzFdICsgeFsyXSAqIHlbMl07CiAgICBjWzBdID0gJ0EnICwgY1sxXSA9ICdCJyAsIGNbMl0gPSAnQyc7CiAgICBpbnQgbCA9IHNxcnQocyk7CiAgICBpZihsICogbCAhPXMpCiAgICB7CiAgICAgICAgY291dCA8PCAtMTsKICAgICAgICByZXR1cm4gMDsKICAgIH0KICAgIGZvcihpbnQgaT0wO2k8MztpKyspCiAgICAgICAgaWYoeFtpXSA+IGwgfHwgeVtpXSA+IGwpCiAgICAgICAgewogICAgICAgICAgICBjb3V0IDw8IC0xOwogICAgICAgICAgICByZXR1cm4gMDsKICAgICAgICB9CiAgICB2ZWN0b3I8aW50PiB2OwogICAgZm9yKGludCBpPTA7aTwzO2krKykKICAgIHsKICAgICAgICBpZih5W2ldID09IGwpCiAgICAgICAgICAgIHN3YXAoeFtpXSx5W2ldKTsKICAgICAgICBpZih4W2ldID09IGwpCiAgICAgICAgICAgIHYucGIoaSk7CiAgICB9CiAgICBpZih2LnNpemUoKSA9PSAzKQogICAgewogICAgICAgIGNvdXQgPDwgbCA8PCBlbmRsOwogICAgICAgIGZvcihpbnQgaT0wO2k8MztpKyspCiAgICAgICAgewogICAgICAgICAgICBmb3IoaW50IGo9MDtqPHlbaV07aisrKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBmb3IoaW50IGs9MDtrPGw7aysrKQogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgY1tpXSA7CiAgICAgICAgICAgICAgICBjb3V0IDw8IGVuZGw7CiAgICAgICAgICAgIH0KICAgICAgICB9CiAgICAgICAgcmV0dXJuIDA7CiAgICB9CiAgICBpZih2LnNpemUoKSA9PSAxKQogICAgewogICAgICAgIGludCBjdXIgPSB5W3ZbMF1dOwogICAgICAgIGludCBsZSA9IGwgLSBjdXI7CiAgICAgICAgaW50IGNvID0gMDsKICAgICAgICBmb3IoaW50IGk9MDtpPDM7aSsrKQogICAgICAgIHsKICAgICAgICAgICAgaWYoaSAhPSB2WzBdKQogICAgICAgICAgICB7CiAgICAgICAgICAgICAgICBpZih5W2ldID09IGxlKQogICAgICAgICAgICAgICAgICAgIHN3YXAoeFtpXSAsIHlbaV0pOwogICAgICAgICAgICAgICAgaWYoeFtpXSA9PSBsZSkKICAgICAgICAgICAgICAgICAgICBjbyArKzsKICAgICAgICAgICAgfQogICAgICAgIH0KICAgICAgICBpZihjbyA9PSAyKQogICAgICAgIHsKICAgICAgICAgICAgY291dCA8PCBsIDw8IGVuZGw7CiAgICAgICAgICAgIGZvcihpbnQgaT0wO2k8Y3VyO2krKykKICAgICAgICAgICAgewogICAgICAgICAgICAgICAgZm9yKGludCBqPTA7ajxsO2orKykKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGNbdlswXV07CiAgICAgICAgICAgICAgICBjb3V0IDw8IGVuZGw7CiAgICAgICAgICAgIH0KICAgICAgICAgICAgaW50IG8xID0gKHZbMF0gKyAxKSAlIDM7CiAgICAgICAgICAgIGludCBvMiA9IChvMSArIDEpICUgMzsKICAgICAgICAgICAgZm9yKGludCBpPTA7aTxsZTtpKyspCiAgICAgICAgICAgIHsKICAgICAgICAgICAgICAgIGZvcihpbnQgaj0wO2o8eVtvMV07aisrKQogICAgICAgICAgICAgICAgICAgIGNvdXQgPDwgY1tvMV07CiAgICAgICAgICAgICAgICBmb3IoaW50IGo9MDtqPHlbbzJdO2orKykKICAgICAgICAgICAgICAgICAgICBjb3V0IDw8IGNbbzJdOwogICAgICAgICAgICAgICAgY291dCA8PCBlbmRsOwogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiAwOwogICAgICAgIH0KICAgIH0KICAgIGNvdXQgPDwgLTEgOwogICAgcmV0dXJuIDA7Cn0=