*Continuing with my said goal ( solving 5 problems per day) This is what I did for the 2 days…*

*I had planned to put 5 problems of the GCJ types and discuss post and lot picked one for the next 2 weeks until July 10th.But I suddenly felt that I was going too easy on myself , so I started doing 20 sums a day since yesterday until I am not able to do 20 sums per day…*

**.**

**.**

**.**

*So doing that I ended up overworking myself… So I ended up cutting down to 3 problems per day… I think I am gradually but definitely losing my motive to seriously participate in the upcoming contest … *sigh*

**.**

**.**

**.**

*Maybe this is what they refer to as anxiety attack!!!*

**So the list of problems that were chosen the last 2 days were:**

- Bytelandian Gold Coins
- Prime Generator
- Clossing the tweets
- Marbles
- The Next Palindrome
- Root of the problem
- Flipping coins
- Array Transforms
- Number of Factors
- Mixtures
- Sreeja nd Votes
- Pairwise AND sum
- One Dimensional Kingdoms
- AND Operations

**So the lot picked problem for today is **

**The next Palindrome…**

**The problem statement :**

A positive integer is called a palindrome if its representation in the decimal system is the same when reading from left to right and from right to left. For a given positive integer K of not more than 1000000 digits, write the value of the smallest palindrome larger than K to output. Numbers are always displayed without leading zeros.

**Input**

The first line contains integer t, the number of test cases. Followed by t lines containing integers K.

**Output**

For each K, output the smallest palindrome larger than K.

**Example**

**Input:**

2

808

2133

**Output:**

818

2222

**Explanation**

Well, this problem is kinda straight forward so I’ll just get down with the code… *sigh

def near_palindrome(n):

if len(n) % 2 == 0: return n[:len(n) // 2] + n[:len(n) // 2][::-1]

return n[:len(n) // 2] + n[len(n) // 2] + n[:len(n) // 2][::-1]

for t in range(int(input())):

n = input()

temp = near_palindrome(n)

if temp > n:

print(temp)

j = len(n) // 2 + len(n) % 2 – 1

**o(╥﹏╥)o**