import sys
import os
import inspect
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
inf = 10 ** 18

if os.getenv("TKTKLOCAL", False):
    def debug(*arg, sep=" ", end="\n"):
        print(*arg, sep=sep, end=end, file=sys.stderr)

    def debug_indent(*arg, sep=" ", end="\n", indent="    "):
        frame = inspect.currentframe().f_back
        par_func = inspect.getframeinfo(frame).function
        if par_func == "<module>":
            debug(*arg, sep=sep, end=end)
            return

        frame_stack = inspect.stack()
        if len(frame_stack) > 30:
            return

        depth = sum(f.function == par_func for f in frame_stack)
        debug(indent * (depth - 1), end="")
        debug(*arg, sep=sep, end=end)
else:
    def debug(*arg, **kwarg):
        pass

    def debug_indent(*arg, **kwarg):
        pass


def is_pari(s):
    return s == s[::-1]


def solve():
    S = input().rstrip()
    N = len(S)

    for i in range(N+1):
        if is_pari(S[i:N]):
            answer = (
                S[0:i],
                S[i:N],
                S[0:i][::-1],
            )
            print("".join(answer))
            return


solve()