Added solution for Cubic permutations