Alex loves Rubik's Cube. The 3-dimensional cubes are so difficult that Alex can only challenge the 2D ones, which have
six colors: W, Y, R, O, G, B.
Alex names the six faces as U(upper), D(bottom), L(left), R(right), F(front), B(back). The expanded cube will appear like
this:
Alex is able to rotate any face 90 degrees in clockwise or counter-clockwise in a second. U, D, L, R, F, B are used for rotating the
corresponding face in clockwise, while U', D', L', R', F', B' are for counter-clockwise.
Now Alex got a Cube, he wants to know the minimum number of steps required for making one state to the other.