PALIN  The Next Palindrome
A positive integer is called a palindrome if its representation in the decimal system is the same when read 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. Integers K are given in the next t lines.
Output
For each K, output the smallest palindrome larger than K.
Example
Input: 2 808 2133 Output: 818 2222
Warning: large Input/Output data, be careful with certain languages
hide comments
ajeetk_973:
20161024 20:50:09
i m getting WA. tell me where to find test cases.. 

rohit1507:
20161019 19:24:05
does '0000' be considered '0' or the places matter? 

secondyearcse:
20161017 17:41:20
thanks @jbirlingmair for test case


jbirlingmair:
20161017 17:36:09
make sure you try test cases like this number:


secondyearcse:
20161017 08:33:00
my code works accurately on code blocks,but i am getting WA here why?? 

♥☻♥ David ♥☻♥:
20161011 21:38:39
I have been trying to solve this problem here. but encountering WA..


ipepe:
20161010 16:39:13
Why can't I use node for this challenge? 

arpan_jain_946:
20161005 11:55:51
For java, I am getting wrong answer, any suggestion???


vaman_t:
20161001 21:13:44
AC. thanks @vector1996 for test cases Last edit: 20161001 21:15:27 

engineer_9999:
20160930 02:17:00
@narutohokage_1

Added by:  adrian 
Date:  20040501 
Time limit:  2s9s 
Source limit:  50000B 
Memory limit:  1536MB 
Cluster:  Cube (Intel G860) 
Languages:  All except: NODEJS PERL 6 