Can anyone help me with The Next Palindrome problem?

I don’t know why it is giving wrong answer. i tried it with many test cases but i still can’t point out the issue. Problem iink and my solution link are:

https://www.codechef.com/problems/PALIN

https://www.codechef.com/viewsolution/14249426

Thanks in advance.

Can you give this article a read first?

If this doesnt help, get back to us ^^

input:

1
11

your output: 22H

correct output: 22