A = input() N = len(A) mid_start = N//2 ans1 = 'X'*300 ans2 = 'X'*300 # 中心が1文字の場合と2文字の場合がある for mid in range(mid_start, N): post_mid = A[mid:] pre_mid = A[mid+1-(N-mid):mid+1][::-1] #print('mid', mid, post_mid, pre_mid) if post_mid == pre_mid: ans1 = A + A[:mid+1-(N-mid)][::-1] print(ans1) break for mid in range(mid_start, N): post_mid = A[mid:] pre_mid = A[mid-(N-mid):mid][::-1] #print('mid', mid, post_mid, pre_mid) if post_mid == pre_mid: ans2 = A + A[:mid-(N-mid)][::-1] print(ans2) break if len(ans1) <= len(ans2): print(ans1) else: print(ans2)