1597. Cube

单点时限: 2.0 sec

内存限制: 256 MB

There was once a 3 by 3 by 3 cube built of 27 smaller cubes. It has fallen apart into seven pieces:

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.

输入格式

The input file has several test cases. Each test case indicates the initial position of piece a. You can translate it, but you mustn’t rotate it.

输出格式

For each solution found, your program should output a line containing the solution as a string. The string is a linearized form of the cube. Each letter stands for the piece filling out the corresponding space in the cube. It is linearized as follows:

The string consists of substrings representing the front, middle and back plane.

Each substring consists of substrings representing the top, middle and bottom row.

Each row substring consists of letters representing the left, middle and right cell.

The solutions in figure 2 would be represented like this:

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: Positions of the cells in the string

Figure 3 again shows how the cells of the cube are linearized.

样例

Input
aa.a..a....................
.........a..a..aa..........
Output
aababbadcggeffcddcgeegfedfc
aababbadceffgdcgdceefedfggc
...
aababbadcffegfcddcfeeggedgc
adcaccaacfddfebgeeffdggbgeb
...

1 人解决,1 人已尝试。

1 份提交通过,共有 2 份提交。

9.9 EMB 奖励。

创建: 16 年,9 月前.

修改: 6 年,3 月前.

最后提交: 4 年,11 月前.

来源: UVa