Patchouli Knowledge(パチュリー·ノーレッジ) is the owner of the Embodiment of Scarlet Devil library. She often shelves books time by time.
For she is careless, Patchouli treats all the books in the same size in the same way.
Give you several books and their sizes (you only need to consider the height of the books), you should output all the books formations Patchouli may shelf.
For each case, you have to output the all the possible formations (According to the height difference). Order by lexicographic order. The height will be outputed in hexadecimal.
1 3 3 D
1 3 D 3
1 D 3 3
3 1 3 D
3 1 D 3
3 3 1 D
3 3 D 1
3 D 1 3
3 D 3 1
D 1 3 3
D 3 1 3
D 3 3 1