s = input() n = len(s) res = '' for i in range(n - 1): res += s[i] res += '$' res += s[n - 1] m = len(res) mid = m // 2 for i in range(mid, m): l, r = i - 1, i + 1 flag = True while l >= 0 and r < m: if res[l] != res[r]: flag = False break l -= 1 r += 1 if flag: l, r = i - 1, i + 1 ans = s while l >= 0: if l % 2 == 0 and r >= m: ans += res[l] l -= 1 r += 1 print(ans) break