Next Special Palindrome Number

Given an integer n, find the smallest special palindrome greater than n. A special palindrome is a string that reads the same forwards and backwards, and all middle characters are the same (e.g., "aba", "aa", "12321").

Examples
Input: 1
Output: 2
Hints

Next Special Palindrome Number

Given an integer n, find the smallest special palindrome greater than n. A special palindrome is a string that reads the same forwards and backwards, and all middle characters are the same (e.g., "aba", "aa", "12321").