using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace olymptest
{
class Program
{
static void Main(string[] args)
{
string numb = Console.ReadLine();
char[] numbchar = new char[numb.Length];
int x = numb.Length;
if (x < 2002)
{
for (int i = 0; i < numb.Length / 2; i++)
{
x--;
numbchar[i] = Convert.ToChar(numb[i]);
numbchar[x] = numbchar[i];
if ((x==numb.Length/2) && (Convert.ToInt32(numb[x]) > Convert.ToInt32(numb[i])))
{
numbchar[i]++;
numbchar[x]++;
}
}
if (numb.Length % 2 != 0)
{
numbchar[numb.Length / 2] = Convert.ToChar(numb[numb.Length / 2]);
if (Convert.ToInt32(numb[numb.Length / 2 + 1]) > Convert.ToInt32(numb[numb.Length / 2]))
{
numbchar[numb.Length/2]++;
}
}
}
Console.WriteLine(numbchar);
Console.ReadLine();
}
}
}