Cube |
There was once a 3 by 3 by 3 cube built of 27 smaller cubes. It has fallen apart into seven pieces:
The seven pieces can be assembled in many ways to again form the cube. Figure 2 shows one of these possibilities. The first square stands for the front plane, the next one for the middle plane and the last one for the back plane of the cube. The letters in the cells stand for the name of piece filling out the corresponding space in the cube. The name of the seven pieces can be found in figure 1.
You are to write a program that outputs all possibilities of assembling the cube but suppress solutions that are mere rotations of another solution.
Hint:
Piece a is the only part that, by rotation and translation, cannot
be transformed into itself. In order to avoid solutions that are mere rotations
of an already found solution, you may restrict transformations of piece
a to translations.
adcaccaacddgbfgffedggbfebee aababbadcffegfcddcfeeggedgc
It is very important that your program uses the naming convention given in figure 1 and linearizes the cube as explained above.
Print a blank line after each test case.
Figure 3 again shows how the cells of the cube are linearized.
aa.a..a.................... .........a..a..aa..........
aababbadcggeffcddcgeegfedfc aababbadceffgdcgdceefedfggc ... aababbadcffegfcddcfeeggedgc adcaccaacddgbfgggedggbfebee ...