using System;
using System.Linq;

namespace Takmicenje
{
    class MainClass
    {
        static string NapraviPalindrom(string s)
        {
            if (s.Length == 1)
                return s;

            char[] vs = s.Distinct().ToArray();
            int q = vs.Length, br_neparnih = 0;
            int[] vs1 = new int[q];
            for (int i = 0; i < s.Length; i++)
            {
                for (int j = 0; j < q; j++)
                {
                    if (s[i] == vs[j])
                    {
                        vs1[j]++;
                    }
                }
            }

            foreach(int p in vs1)
            {
                if (p % 2 == 1) br_neparnih++;
            }

            if (br_neparnih > 1) return "ne moze";

            int polozaj = 0, moto = 0;
            foreach (int p in vs1)
            {
                if (p % 2 == 1) polozaj = moto;
                moto++;
            }

            string prva = "", druga = "";

            for (int i = 0; i < vs1.Length; i++)
            {
                int k = vs1[i] / 2, j = 0;

                while (j < k)
                {
                    prva += vs[i];
                    druga = vs[i] + druga;
                    j++;
                }
            }

            if (br_neparnih == 0)
                return prva + druga;
            else
                return prva + vs[polozaj] + druga;
        }
        static string Reverse(string s)
        {
            string s1 = new string(s.ToCharArray().Reverse().ToArray());
            return s1;
        }
        public static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string s1 = Reverse(s);

            if (s1 == s)
            {
                Console.WriteLine(1);
                Environment.Exit(0);
            }

            s1 = NapraviPalindrom(s);

            int pocetak = 0, kraj = 0, pk = 0;

            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] != s1[i] && pk == 0)
                    pocetak = i;
                if (s[i] != s1[i] && pk != 0)
                    kraj = i;
            }

            pk = kraj - pocetak;
            Console.WriteLine(s1);
        }
    }
}