Python Hard
```python3 []
class Solution:
    def permute(self, N: int, k: int) -> List[int]:
        k -= 1
        
        if N % 2 == 1:
            odd = N // 2 + 1
            even = N // 2
            if factorial(odd) * factorial(even) <= k:
                return []
            
            total = factorial(odd) * factorial(even)
            
            
            ans = []
            seen = set()  
            turn = 1
            
            while even or odd:
                if turn == 0:
                      
                    t = 0
                    j = 2
                    while j in seen:
                        j += 2
                    while t + factorial(odd) * factorial(even - 1) <= k:
                        t += factorial(odd) * factorial(even - 1)
                        j += 2
                        while j in seen:
                            j += 2
                              
                    ans.append(j)
                    seen.add(j)
                    
                    k -= t
                    turn = 1
                    even -= 1
                    
                elif turn == 1:
                    t = 0
                    j = 1
                    while j in seen:
                        j += 2
                    while t + factorial(odd - 1) * factorial(even) <= k:
                        t += factorial(odd - 1) * factorial(even)
                        j += 2
                        while j in seen:
                            j += 2
                              
                    ans.append(j)
                    seen.add(j)

                    k -= t              
                    turn = 0
                    odd -= 1
                    
                    
            return ans
        
        
        else:
            odd = N // 2
            even = N // 2
            if factorial(odd) * factorial(even) * 2 <= k:
                return []
            
            t = 0
            j = 1
           
            while t + factorial(odd) * factorial(even - 1) <= k:
                t += factorial(odd) * factorial(even - 1)
                j += 1

            ans = []
            seen = set() 
            ans.append(j)
            seen.add(j)
            k -= t

            if j % 2 == 1:
                turn = 0
                odd -= 1
            else:
                turn = 1
                even -= 1




            while even or odd:
                if turn == 0:
                      
                    t = 0
                    j = 2
                    while j in seen:
                        j += 2
                    while t + factorial(odd) * factorial(even - 1) <= k:
                        t += factorial(odd) * factorial(even - 1)
                        j += 2
                        while j in seen:
                            j += 2
                              
                    ans.append(j)
                    seen.add(j)
                    
                    k -= t
                    turn = 1
                    even -= 1
                    
                elif turn == 1:
                    t = 0
                    j = 1
                    while j in seen:
                        j += 2
                    while t + factorial(odd - 1) * factorial(even) <= k:
                        t += factorial(odd - 1) * factorial(even)
                        j += 2
                        while j in seen:
                            j += 2
                              
                    ans.append(j)
                    seen.add(j)

                    k -= t              
                    turn = 0
                    odd -= 1
                    
                    
            return ans
            
    
        
        
        
        
        
        
        
        
        
        
        
        
        
```
['Python3']