A solver for snake cube problem