Three companies decided to order a billboard with pictures of their logos. A billboard is a big square board. A logo of each company is a rectangle of a non-zero area. 

Advertisers will put up the ad only if it is possible to place all three logos on the billboard so that they do not overlap and the billboard has no empty space left. When you put a logo on the billboard, you should rotate it so that the sides were parallel to the sides of the billboard.

Your task is to determine if it is possible to put the logos of all the three companies on some square billboard without breaking any of the described rules.

Input

The first line of the input contains six positive integers x1, y1, x2, y2, x3, y3 (1 ≤ x1, y1, x2, y2, x3, y3 ≤ 100), where xi and yi determine the length and width of the logo of the i-th company respectively.

Output

If it is impossible to place all the three logos on a square shield, print a single integer "-1" (without the quotes).

If it is possible, print in the first line the length of a side of square n, where you can place all the three logos. Each of the next n lines should contain n uppercase English letters "A", "B" or "C". The sets of the same letters should form solid rectangles, provided that:

  * the sizes of the rectangle composed from letters "A" should be equal to the sizes of the logo of the first company, 
  * the sizes of the rectangle composed from letters "B" should be equal to the sizes of the logo of the second company, 
  * the sizes of the rectangle composed from letters "C" should be equal to the sizes of the logo of the third company, 



Note that the logos of the companies can be rotated for printing on the billboard. The billboard mustn't have any empty space. If a square billboard can be filled with the logos in multiple ways, you are allowed to print any of them.

See the samples to better understand the statement.

Examples

Input

5 1 2 5 5 2


Output

5
AAAAA
BBBBB
BBBBB
CCCCC
CCCCC


Input

4 4 2 6 4 2


Output

6
BBBBBB
BBBBBB
AAAACC
AAAACC
AAAACC
AAAACC
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 205;
const long long int mod = 1000000007;
const long long int inf = 1e18;
long long int gc(long long int a, long long int b) {
  if (b == 0) return a;
  return gc(b, a % b);
}
long long int power(long long int x, long long int y, long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
vector<bool> prime(100005, true);
vector<long long int> v;
void sieve(long long int n) {
  prime[1] = false;
  for (int p = 2; p * p <= n; p++) {
    if (prime[p] == true) {
      for (int i = p * p; i <= n; i += p) prime[i] = false;
    }
  }
  for (int i = 2; i <= n; i++) {
    if (prime[i] == true) v.push_back(i);
  }
}
bool comp(pair<long long int, long long int>& p1,
          pair<long long int, long long int>& p2) {
  return (p1.second < p2.second);
}
int BIT[1000];
void update(int x, int delta) {
  int n;
  for (; x <= n; x += x & -x) BIT[x] += delta;
}
int query(int x) {
  int sum = 0;
  for (; x > 0; x -= x & -x) sum += BIT[x];
  return sum;
}
vector<vector<long long int> > dp(30005, vector<long long int>(248, -1));
void lcs() {
  vector<int> d;
  int ans, n;
  for (int i = 0; i < n; i++) {
    int x;
    scanf("%d", &x);
    vector<int>::iterator it = upper_bound(d.begin(), d.end(), x);
    if (it == d.end())
      d.push_back(x);
    else
      *it = x;
  }
  printf("LIS = %d", d.size());
}
long long int dfs(long long int src, long long int p,
                  vector<long long int> adj[], vector<long long int>& sz) {
  sz[src] = 1;
  for (int i = 0; i < adj[src].size(); i++) {
    long long int v = adj[src][i];
    if (v == p) continue;
    sz[src] += dfs(v, src, adj, sz);
  }
  return sz[src];
}
void dfs2(long long int src, long long int p, vector<long long int> adj[],
          vector<long long int>& dp, vector<long long int>& ans,
          long long int m) {
  ans[src] = dp[src];
  for (int i = 0; i < adj[src].size(); i++) {
    long long int v = adj[src][i];
    if (v == p) continue;
    dp[src] /= (dp[v] + 1);
    dp[v] = ((dp[v] % m) * (dp[src] + 1) % m) % m;
    dfs2(v, src, adj, dp, ans, m);
    dp[v] /= (dp[src] + 1);
    dp[src] = ((dp[src] % m) * (dp[v] + 1) % m);
  }
  return;
}
inline long long int add(long long int a, long long int b) {
  return ((a % mod) + (b % mod)) % mod;
}
inline long long int sub(long long int a, long long int b) {
  return ((a % mod) - (b % mod) + mod) % mod;
}
inline long long int mul(long long int a, long long int b) {
  return ((a % mod) * (b % mod)) % mod;
}
long long int dfs1(vector<long long int> adj[], long long int src,
                   long long int p, long long int col,
                   vector<long long int>& dp) {
  dp[src] = 1;
  for (int i = 0; i < adj[src].size(); i++) {
    long long int v = adj[src][i];
    if (v == p) continue;
    long long int st = dfs1(adj, v, src, 1, dp);
    if (col == 1) {
      long long int temp = 0;
      temp = add(temp, dfs1(adj, v, src, 0, dp));
      temp = add(temp, st);
      dp[src] = mul(dp[src], temp);
    } else {
      dp[src] = mul(dp[src], st);
    }
  }
  return dp[src];
}
long long int solution(vector<long long int> A, long long int k) {
  long long int N = A.size();
  if (N < k || N < 1 || k < 1) return 0;
  if (N == k) return 1;
  vector<long long int> v1(N, 0);
  vector<long long int> v2(N, 0);
  vector<long long int> v3(N, 0);
  v2[N - 1] = 1;
  v3[A[N - 1] - 1] = 1;
  for (long long int i = N - 2; i >= 0; i--) {
    v2[i] = v2[i + 1];
    if (v3[A[i] - 1] == 0) {
      v2[i]++;
      v3[A[i] - 1] = 1;
    }
  }
  for (long long int j = 1; j < k; j++) {
    fill(v3.begin(), v3.end(), 0);
    v1[N - 1] = 0;
    for (long long int i = N - 2; i >= 0; i--) {
      v1[i] = v1[i + 1];
      v1[i] = v1[i] + v2[i + 1];
      v1[i] = v1[i] - v3[A[i] - 1];
      v3[A[i] - 1] = v2[i + 1];
    }
    v2 = v1;
  }
  return v1[0];
}
long long int recur(long long int idx, long long int sum,
                    vector<pair<long long int, long long int> >& v,
                    vector<long long int>& b, vector<long long int>& pre,
                    vector<long long int>& dp) {
  if (idx == b.size()) return 0;
  if (dp[idx] != -1) return dp[idx];
  long long int temp = INT_MAX;
  temp = min(temp, recur(idx + 1, sum, v, b, pre, dp) + b[idx]);
  for (int i = 0; i < v.size(); i++) {
    long long int x = v[i].first;
    long long int y = v[i].second;
    if (idx + x - 1 >= b.size()) continue;
    long long int calc = pre[idx + x - 1] - pre[idx + y - 1];
    temp = min(temp, recur(idx + x, sum, v, b, pre, dp) + calc);
  }
  dp[idx] = temp;
  return temp;
}
set<pair<long long int, long long int> > temp;
void dfs(long long int src, vector<long long int>& p,
         vector<long long int> adj[], vector<bool>& vis, vector<bool>& v) {
  vector<long long int>::iterator it;
  vis[src] = true;
  for (it = adj[src].begin(); it != adj[src].end(); it++) {
    if ((*it) == p[src]) continue;
    if (!vis[*it]) {
      p[*it] = src;
      dfs((*it), p, adj, vis, v);
    } else {
      if (v[*it] == true)
        continue;
      else {
        long long int c = (*it);
        long long int d = src;
        temp.insert(make_pair(c, d));
        v[c] = true;
        v[d] = true;
        long long int coun = 1;
        while (d != c) {
          temp.insert(make_pair(d, p[d]));
          coun++;
          v[p[d]] = true;
          d = p[d];
        }
      }
    }
  }
}
long long int recur(long long int idx, long long int k, long long int n) {
  if (idx == n) return 1;
  if (idx > n) return 0;
  long long int temp = 0;
  temp += recur(idx + 1, k, n);
  temp += (idx + k, k, n);
  return temp;
}
long long int find(long long int u, vector<long long int>& parent) {
  if (u == parent[u])
    return u;
  else
    return parent[u] = find(parent[u], parent);
}
void unio(long long int u, long long int v, vector<long long int>& parent,
          vector<long long int>& ran, map<long long int, long long int>& m1) {
  u = find(u, parent);
  v = find(v, parent);
  if (u == v) return;
  if (ran[u] >= ran[v]) {
    parent[v] = u;
    ran[u] += v;
    m1[u] += m1[v];
  } else {
    parent[u] = v;
    ran[v] += u;
    m1[v] += m1[u];
  }
}
long long int dfs(long long int src, long long int p, vector<long long int>& a,
                  vector<pair<long long int, long long int> > adj[],
                  vector<long long int>& dp) {
  long long int can1 = 0;
  long long int can2 = 0;
  vector<pair<long long int, long long int> >::iterator it;
  for (it = adj[src].begin(); it != adj[src].end(); it++) {
    if (((*it).first == p)) continue;
    long long int st =
        max(0LL, dfs((*it).first, src, a, adj, dp) - (*it).second);
    if (st > can1) {
      can2 = can1;
      can1 = st;
    } else if (st > can2) {
      can2 = st;
    }
  }
  dp[src] = a[src] + can1 + can2;
  return (max(can1, can2) + a[src]);
}
map<long long int, long long int> ma;
map<pair<long long int, long long int>, long long int> m2;
void dfs(long long int src, vector<pair<long long int, long long int> > adj[],
         vector<bool>& vis, long long int coun, vector<long long int>& asign) {
  vis[src] = true;
  asign[src] = coun;
  for (int i = 0; i < adj[src].size(); i++) {
    long long int nod = adj[src][i].first;
    long long int w = adj[src][i].second;
    if (vis[nod] || w != 0) continue;
    dfs(nod, adj, vis, coun, asign);
  }
}
vector<long long int> adj[100005];
vector<long long int> d(100005);
long long int dfs(long long int src, long long int p,
                  vector<long long int>& sub) {
  sub[src] = 1;
  for (int i = 0; i < adj[src].size(); i++) {
    if (adj[src][i] == p) continue;
    dfs(adj[src][i], src, sub);
    sub[src] += (sub[adj[src][i]]);
  }
  return sub[src];
}
struct comp1 {
  bool operator()(pair<long long int, long long int>& temp1,
                  pair<long long int, long long int>& temp2) {
    return (d[temp1.second] < d[temp2.second] ||
            (d[temp1.second] == d[temp2.second] &&
             adj[temp1.second].size() > adj[temp2.second].size()));
  }
};
bool comp2(pair<long long int, long long int>& temp1,
           pair<long long int, long long int>& temp2) {
  return temp1.second < temp2.second;
}
int main() {
  long long int m = 0;
  long long int x1, y1, x2, y2, x3, y3;
  cin >> x1 >> y1 >> x2 >> y2 >> x3 >> y3;
  m = max(m, max(x1, max(x2, max(x3, max(y2, max(y1, y3))))));
  bool f1 = false, f2 = false, f3 = false;
  if ((m == x1) || (m == y1)) f1 = true;
  if ((m == x2) || (m == y2)) f2 = true;
  if ((m == x3) || (m == y3)) f3 = true;
  if (f1 == true && f2 == true && f3 == true) {
    long long int sum = 0;
    long long int num1, num2, num3;
    if (x1 == m) {
      sum += y1;
      num1 = y1;
    } else {
      sum += x1;
      num1 = x1;
    }
    if (x2 == m) {
      sum += y2;
      num2 = y2;
    } else {
      sum += x2;
      num2 = x2;
    }
    if (x3 == m) {
      sum += y3;
      num3 = y3;
    } else {
      sum += x3;
      num3 = x3;
    }
    if (sum != m)
      cout << -1;
    else {
      cout << m << endl;
      for (int i = 0; i < num1; i++) {
        for (int j = 0; j < m; j++) cout << "A";
        cout << endl;
      }
      for (int i = 0; i < num2; i++) {
        for (int j = 0; j < m; j++) cout << "B";
        cout << endl;
      }
      for (int i = 0; i < num3; i++) {
        for (int j = 0; j < m; j++) cout << "C";
        cout << endl;
      }
    }
  } else if (f1 == true && f2 == true) {
    cout << -1;
  } else if (f1 == true && f3 == true) {
    cout << -1;
  } else if (f3 == true && f2 == true) {
    cout << -1;
  } else if (f1 == true) {
    long long int fac;
    if (x1 == m)
      fac = m - y1;
    else
      fac = m - x1;
    long long int b = 0;
    long long int coun = 0;
    if (x2 == fac) {
      coun++;
      b |= (1 << 0);
    }
    if (x3 == fac) {
      coun++;
      b |= (1 << 1);
    }
    if (y2 == fac) {
      coun++;
      b |= (1 << 2);
    }
    if (y3 == fac) {
      coun++;
      b |= (1 << 3);
    }
    if (coun == 1 || coun == 0 || coun == 4)
      cout << -1;
    else if (coun == 3) {
      long long int num;
      for (int i = 0; i <= 3; i++) {
        if (((1 << i) & b) == 0) {
          if (i == 0)
            num = x2;
          else if (i == 1)
            num = x3;
          else if (i == 2)
            num = y2;
          else
            num = y3;
        }
      }
      if ((num + fac) != m)
        cout << -1;
      else {
        if (num <= fac) {
          cout << m << endl;
          for (int i = 0; i < (min(x1, y1)); i++) {
            for (int j = 0; j < m; j++) cout << "A";
            cout << endl;
          }
          for (int i = 0; i < fac; i++) {
            for (int j = 0; j < min(y2, x2); j++) cout << "B";
            for (int j = 0; j < min(x3, y3); j++) cout << "C";
            cout << endl;
          }
        } else {
          cout << m << endl;
          for (int i = 0; i < (min(x1, y1)); i++) {
            for (int j = 0; j < m; j++) cout << "A";
            cout << endl;
          }
          for (int i = 0; i < fac; i++) {
            for (int j = 0; j < max(y2, x2); j++) cout << "B";
            for (int j = 0; j < max(x3, y3); j++) cout << "C";
            cout << endl;
          }
        }
      }
    } else if ((x2 == fac && y2 == fac) || (x3 == fac && y3 == fac))
      cout << -1;
    else if (x2 == fac && x3 == fac && (y2 + y3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x1, y1)); i++) {
        for (int j = 0; j < m; j++) cout << "A";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < y2; j++) cout << "B";
        for (int j = 0; j < y3; j++) cout << "C";
        cout << endl;
      }
    } else if (x2 == fac && y3 == fac && (y2 + x3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x1, y1)); i++) {
        for (int j = 0; j < m; j++) cout << "A";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < y2; j++) cout << "B";
        for (int j = 0; j < x3; j++) cout << "C";
        cout << endl;
      }
    } else if (y2 == fac && x3 == fac && (x2 + y3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x1, y1)); i++) {
        for (int j = 0; j < m; j++) cout << "A";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < x2; j++) cout << "B";
        for (int j = 0; j < y3; j++) cout << "C";
        cout << endl;
      }
    } else if (y2 == fac && y3 == fac && (x2 + x3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x1, y1)); i++) {
        for (int j = 0; j < m; j++) cout << "A";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < x2; j++) cout << "B";
        for (int j = 0; j < x3; j++) cout << "C";
        cout << endl;
      }
    } else
      cout << -1;
  } else if (f2 == true) {
    long long int fac;
    if (x2 == m)
      fac = m - y2;
    else
      fac = m - x2;
    long long int b = 0;
    long long int coun = 0;
    if (x1 == fac) {
      coun++;
      b |= (1 << 0);
    }
    if (x3 == fac) {
      coun++;
      b |= (1 << 1);
    }
    if (y1 == fac) {
      coun++;
      b |= (1 << 2);
    }
    if (y3 == fac) {
      coun++;
      b |= (1 << 3);
    }
    if (coun == 1 || coun == 0 || coun == 4)
      cout << -1;
    else if (coun == 3) {
      long long int num;
      for (int i = 0; i <= 3; i++) {
        if (((1 << i) & b) == 0) {
          if (i == 0)
            num = x1;
          else if (i == 1)
            num = x3;
          else if (i == 2)
            num = y1;
          else
            num = y3;
        }
      }
      if ((num + fac) != m)
        cout << -1;
      else {
        if (num <= fac) {
          cout << m << endl;
          for (int i = 0; i < (min(x2, y2)); i++) {
            for (int j = 0; j < m; j++) cout << "B";
            cout << endl;
          }
          for (int i = 0; i < fac; i++) {
            for (int j = 0; j < (min(x1, y1)); j++) cout << "A";
            for (int j = 0; j < (min(x3, y3)); j++) cout << "C";
            cout << endl;
          }
        } else {
          cout << m << endl;
          for (int i = 0; i < (min(x2, y2)); i++) {
            for (int j = 0; j < m; j++) cout << "B";
            cout << endl;
          }
          for (int i = 0; i < fac; i++) {
            for (int j = 0; j < (max(x1, y1)); j++) cout << "A";
            for (int j = 0; j < (max(x3, y3)); j++) cout << "C";
            cout << endl;
          }
        }
      }
    } else if ((x1 == fac && y1 == fac) || (x3 == fac && y3 == fac))
      cout << -1;
    else if (x1 == fac && x3 == fac && (y1 + y3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x2, y2)); i++) {
        for (int j = 0; j < m; j++) cout << "B";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < y1; j++) cout << "A";
        for (int j = 0; j < y3; j++) cout << "C";
        cout << endl;
      }
    } else if (x1 == fac && y3 == fac && (y1 + x3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x2, y2)); i++) {
        for (int j = 0; j < m; j++) cout << "B";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < y1; j++) cout << "A";
        for (int j = 0; j < x3; j++) cout << "C";
        cout << endl;
      }
    } else if (y1 == fac && x3 == fac && (x1 + y3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x2, y2)); i++) {
        for (int j = 0; j < m; j++) cout << "B";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < x1; j++) cout << "A";
        for (int j = 0; j < y3; j++) cout << "C";
        cout << endl;
      }
    } else if (y1 == fac && y3 == fac && (x1 + x3) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x2, y2)); i++) {
        for (int j = 0; j < m; j++) cout << "B";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < x1; j++) cout << "A";
        for (int j = 0; j < x3; j++) cout << "C";
        cout << endl;
      }
    } else
      cout << -1;
  } else if (f3 == true) {
    long long int fac;
    if (x3 == m)
      fac = m - y3;
    else
      fac = m - x3;
    long long int b = 0;
    long long int coun = 0;
    if (x2 == fac) {
      coun++;
      b |= (1 << 0);
    }
    if (x1 == fac) {
      coun++;
      b |= (1 << 1);
    }
    if (y2 == fac) {
      coun++;
      b |= (1 << 2);
    }
    if (y1 == fac) {
      coun++;
      b |= (1 << 3);
    }
    if (coun == 1 || coun == 0 || coun == 4)
      cout << -1;
    else if (coun == 3) {
      long long int num;
      for (int i = 0; i <= 3; i++) {
        if (((1 << i) & b) == 0) {
          if (i == 0)
            num = x2;
          else if (i == 1)
            num = x1;
          else if (i == 2)
            num = y2;
          else
            num = y1;
        }
      }
      if ((num + fac) != m)
        cout << -1;
      else {
        if (num <= fac) {
          cout << m << endl;
          for (int i = 0; i < (min(x3, y3)); i++) {
            for (int j = 0; j < m; j++) cout << "C";
            cout << endl;
          }
          for (int i = 0; i < x2; i++) {
            for (int j = 0; j < min(x2, y2); j++) cout << "B";
            for (int j = 0; j < min(x1, y1); j++) cout << "A";
            cout << endl;
          }
        } else {
          cout << m << endl;
          for (int i = 0; i < (min(x3, y3)); i++) {
            for (int j = 0; j < m; j++) cout << "C";
            cout << endl;
          }
          for (int i = 0; i < x2; i++) {
            for (int j = 0; j < max(x2, y2); j++) cout << "B";
            for (int j = 0; j < max(x1, y1); j++) cout << "A";
            cout << endl;
          }
        }
      }
    } else if ((x2 == fac && y2 == fac) || (x1 == fac && y1 == fac))
      cout << -1;
    else if (x2 == fac && x1 == fac && (y2 + y1) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x3, y3)); i++) {
        for (int j = 0; j < m; j++) cout << "C";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < y2; j++) cout << "B";
        for (int j = 0; j < y1; j++) cout << "A";
        cout << endl;
      }
    } else if (x2 == fac && y1 == fac && (y2 + x1) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x3, y3)); i++) {
        for (int j = 0; j < m; j++) cout << "C";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < y2; j++) cout << "B";
        for (int j = 0; j < x1; j++) cout << "A";
        cout << endl;
      }
    } else if (y2 == fac && x1 == fac && (x2 + y1) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x3, y3)); i++) {
        for (int j = 0; j < m; j++) cout << "C";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < x2; j++) cout << "B";
        for (int j = 0; j < y1; j++) cout << "A";
        cout << endl;
      }
    } else if (y2 == fac && y1 == fac && (x2 + x1) == m) {
      cout << m << endl;
      for (int i = 0; i < (min(x3, y3)); i++) {
        for (int j = 0; j < m; j++) cout << "C";
        cout << endl;
      }
      for (int i = 0; i < fac; i++) {
        for (int j = 0; j < x2; j++) cout << "B";
        for (int j = 0; j < x1; j++) cout << "A";
        cout << endl;
      }
    } else
      cout << -1;
  }
}
