In this problem we will consider words of size
,
made from letters ‘x’, ‘y’ and
‘z’, and without more than
equal consecutive letters. Write a program that writes all words that
satisfy these constraints.
Input consists of several cases, each with an between 1 and 15 and a between 1 and .
For each case, write in alphabetical order all words of length
made from letters ‘x’, ‘y’ and
‘z’ that do not contain
equal consecutive letters. Write a line with 20 hyphens at the end of
each case.
Input
1 1 2 2 3 1
Output
x y z -------------------- xx xy xz yx yy yz zx zy zz -------------------- xyx xyz xzx xzy yxy yxz yzx yzy zxy zxz zyx zyz --------------------