Problem in The Next Palindrome

Problem Code: PALIN
Even after trying several test cases, I’m facing the WA problem.
Any help will be appreciated.
Here is the link to my solution:

@sk92907 Actually you must have read the problem incorrectly. It says that k has digits not more than 10^6.
That means k can be upto 10^(1000000). Basically you can’t store it in any numeric data type. Input it as a string.

Link to my code for reference

thanks a lot for clearing this. (: