JAVA Simple Solution
\nclass Solution {\n    \n    public String getPath(int[][] dp,int r,int c,int k){\n        if(r == 0 && c == 0){\n            return "";\n        }\n        if
```\nclass Solution {\n    \n    public String getPath(int[][] dp,int r,int c,int k){\n        if(r == 0 && c == 0){\n            return "";\n        }\n        if(r == 0) {\n            return "H" + getPath(dp,r,c-1,k);\n        } else if(c == 0){\n            return "V" + getPath(dp,r-1,c,k);\n        } else if(k <= dp[r+c-1][c-1]){\n            return "H" + getPath(dp,r,c-1,k);\n        } else {\n            return "V" + getPath(dp,r-1,c,k-dp[r+c-1][c-1]);\n        }\n    }\n    \n    public void makeTriangle(int[][] dp) {\n        int i, j;\n        dp[0][0] = 1; \n        for(i = 1; i < dp.length; i++) {\n            dp[i][0] = 1; \n            for(j = 1; j <= i; j++) {\n                dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j];\n            }\n        }\n    }\n    \n    public String kthSmallestPath(int[] d, int k) {\n\n        int[][] dp = new int[d[0]+d[1]+1][d[0]+d[1]+1];\n        String res = "";\n        makeTriangle(dp);\n        res = getPath(dp,d[0],d[1],k);\n        \n        return res;\n        \n    }\n}\n```
[]