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;
int main() {
  int x[30], y[30], k = 0, n = 0, s = 0;
  for (int i = 1; i <= 3; i++) {
    cin >> x[i] >> y[i];
    if (x[i] > k) k = x[i], n = i, s = y[i];
    if (y[i] > k) k = y[i], n = i, s = x[i];
  }
  int n1 = 0, s1 = 0;
  for (int i = 1; i <= 3; i++) {
    if (n == i) continue;
    if (x[i] == k - s) n1 = i, s1 = y[i];
    if (y[i] == k - s) n1 = i, s1 = x[i];
  }
  int d = 6 - (n1 + n);
  if ((x[d] == k - s && y[d] == k - s1) || (x[d] == k - s1 && y[d] == k - s)) {
    cout << k << endl;
    for (int i = 1; i <= k; i++) {
      for (int j = 1; j <= k; j++) {
        if (i <= s) {
          if (n == 1)
            cout << "A";
          else if (n == 2)
            cout << "B";
          else
            cout << "C";
        } else if (j <= s1) {
          if (n1 == 1)
            cout << "A";
          else if (n1 == 2)
            cout << "B";
          else
            cout << "C";
        } else {
          if (d == 1)
            cout << "A";
          else if (d == 2)
            cout << "B";
          else
            cout << "C";
        }
      }
      cout << endl;
    }
  } else if (max(x[1], y[1]) == max(x[2], y[2]) && max(x[3], y[3]) == k &&
             min(x[1], y[1]) + min(x[2], y[2]) + min(x[3], y[3]) == k) {
    cout << k << endl;
    for (int i = 1; i <= k; i++) {
      for (int j = 1; j <= k; j++) {
        if (i <= min(x[1], y[1])) {
          cout << "A";
        } else if (i <= min(x[2], y[2]) + min(x[1], y[1])) {
          cout << "B";
        } else {
          cout << "C";
        }
      }
      cout << endl;
    }
  } else
    cout << -1;
  return 0;
}
