193_C. Hamming Distance
Hamming distance between strings a and b of equal length (denoted by h(a, b)) is equal to the number of distinct integers i (1 ≤ i ≤ |a|), such that ai ≠ bi, where ai is the i-th symbol of string a, bi is the i-th symbol of string b. For example, the Hamming distance between strings "aba" and "bba" equals 1, they have different first symbols. For strings "bbba" and "aaab" the Hamming distance equals 4.

John Doe had a paper on which four strings of equal length s1, s2, s3 and s4 were written. Each string si consisted only of lowercase letters "a" and "b". John found the Hamming distances between all pairs of strings he had. Then he lost the paper with the strings but he didn't lose the Hamming distances between all pairs.

Help John restore the strings; find some four strings s'1, s'2, s'3, s'4 of equal length that consist only of lowercase letters "a" and "b", such that the pairwise Hamming distances between them are the same as between John's strings. More formally, set s'i must satisfy the condition <image>. 

To make the strings easier to put down on a piece of paper, you should choose among all suitable sets of strings the one that has strings of minimum length. 

Input

The first line contains space-separated integers h(s1, s2), h(s1, s3), h(s1, s4). The second line contains space-separated integers h(s2, s3) and h(s2, s4). The third line contains the single integer h(s3, s4).

All given integers h(si, sj) are non-negative and do not exceed 105. It is guaranteed that at least one number h(si, sj) is positive.

Output

Print -1 if there's no suitable set of strings.

Otherwise print on the first line number len — the length of each string. On the i-th of the next four lines print string s'i. If there are multiple sets with the minimum length of the strings, print any of them. 

Examples

Input

4 4 4
4 4
4


Output

6
aaaabb
aabbaa
bbaaaa
bbbbbb
```python
def get_input():

    a, b, d = map(int, input().split())

    c, e = map(int, input().split())

    f = int(input())

    return [a, b, c, d, e, f]





def check_condition(a, b, c, d, e, f):

    condition1 = (a + b + c) % 2 == 0

    condition2 = (d + e + a) % 2 == 0

    condition3 = (e + f + c) % 2 == 0

    condition4 = (d + f + b) % 2 == 0

    condition = condition1 and condition2 and condition3 and condition4

    return condition





def find_t(a, b, c, d, e, f):

    t_min1 = round((d + f - a - c) / 2)

    t_min2 = round((e + f - a - b) / 2)

    t_min3 = round((d + e - b - c) / 2)

    t_min4 = 0

    t_min = max(t_min1, t_min2, t_min3, t_min4)

    t_max1 = round((d + e - a) / 2)

    t_max2 = round((e + f - c) / 2)

    t_max3 = round((d + f - b) / 2)

    t_max = min(t_max1, t_max2, t_max3)

    if t_min <= t_max:

        return t_min

    else:

        return -1





def find_all(a, b, c, d, e, f, t):

    x1 = round((a + c - d - f) / 2 + t)

    x2 = round((d + f - b) / 2 - t)

    y1 = round((a + b - e - f) / 2 + t)

    y2 = round((e + f - c) / 2 - t)

    z1 = round((b + c - d - e) / 2 + t)

    z2 = round((d + e - a) / 2 - t)

    return [x1, x2, y1, y2, z1, z2]





def generate_string(x1, x2, y1, y2, z1, z2, t):

    n = x1 + x2 + y1 + y2 + z1 + z2 + t

    s1 = ''.join(['a'] * n)

    s2 = ''.join(['a'] * (z1 + z2 + t)) + ''.join(['b'] * (x1 + x2 + y1 + y2))

    s3 = ''.join(['a'] * t) + ''.join(['b'] * (y1 + y2 + z1 + z2)) + ''.join(['a'] * (x1 + x2))

    s4 = ''.join(['b'] * (t + z2)) + ''.join(['a'] * (z1 + y2)) + ''.join(['b'] * (y1 + x2)) + ''.join(['a'] * x1)

    return [s1, s2, s3, s4]





def __main__():

    fail_output = "-1"

    a, b, c, d, e, f = map(int, get_input())

    if not(check_condition(a, b, c, d, e, f)):

        print(fail_output)

        return False

    t = find_t(a, b, c, d, e, f)

    if t < 0:

        print(fail_output)

        return False

    x1, x2, y1, y2, z1, z2 = map(int, find_all(a, b, c, d, e, f, t))

    s1, s2, s3, s4 = map(str, generate_string(x1, x2, y1, y2, z1, z2, t))

    print(str(x1 + x2 + y1 + y2 + z1 + z2 + t) + '\n')

    print(s1 + '\n')

    print(s2 + '\n')

    print(s3 + '\n')

    print(s4 + '\n')





__main__()





# Made By Mostafa_Khaled
```