HDOJ 5292 Pocket Cube 構造
It was a Pocket Cube. Unfortunately, the Cube fell to the ground and broke. It took you some time to explore the construction of the Cube. Then you assembled the Pocket Cube. Unfortunately, you didn’t assembled it in the right way. So here is the question. You want to know whether it can return to the right position.
The right position means four blocks in each face has the same color. You can only rotate the Cube to return it to the right position.
A Cube is given in its layout.
The right position rotates in red face clockwisely.
You can get more details from input case.
w represents white , y represents yellow , o represents orange , r represents red , g represents green , b represents blue. In the right position, white and yellow , orange and red , green and blue are in the opposite face.