CF193C Hamming Distance

Description

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

Input Format

The first line contains space-separated integers $ h(s_{1},s_{2}) $ , $ h(s_{1},s_{3}) $ , $ h(s_{1},s_{4}) $ . The second line contains space-separated integers $ h(s_{2},s_{3}) $ and $ h(s_{2},s_{4}) $ . The third line contains the single integer $ h(s_{3},s_{4}) $ . All given integers $ h(s_{i},s_{j}) $ are non-negative and do not exceed $ 10^{5} $ . It is guaranteed that at least one number $ h(s_{i},s_{j}) $ is positive.

Output Format

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.