Generate the kth permutation in permutation sequence.