Олимпиадный тренинг

Задача 34850. next palindrome


Задача

Темы:
A natural number is called a palindrome if its decimal notation reads the same from left to right and from right to left. Given a natural number N, determine the next natural number (that is, the smallest number that is greater than N) that is a palindrome.
The program receives one natural number N as input.
The program should print the smallest natural number that is greater than N and is a palindrome.
 
Input Output
4321 4334