Greedily choose using path count formula
\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n        x, y = destination\n        res = []\n        for _ in range(x
```\nclass Solution:\n    def kthSmallestPath(self, destination: List[int], k: int) -> str:\n        x, y = destination\n        res = []\n        for _ in range(x + y):\n            right = math.comb(x + y - 1, x)\n            down = math.comb(x + y - 1, y)\n            for d, ctr, newx, newy in [("H", right, x, y - 1), ("V", down, x - 1, y)]:\n                if k > ctr:\n                    k -= ctr\n                else:\n                    x, y = newx, newy\n                    res.append(d)\n                    break\n        return "".join(res)\n```
['Python']