Rubik's Cube Restoration Algorithm (C language)