美团3.18回文串蹲纠错
= =
lis = list(input()) l = len(lis) flag = 0 ans = [] for i in range(l//2): if not lis[i] == lis[l-1-i]: flag += 1 ans.append(i) if flag == 1: if lis[ans[0]] == 'a' or lis[l-1-ans[0]] =='a': if l%2: lis[l//2] = 'a' lis[ans[0]] = lis[l - 1 - ans[0]] = 'a' print("".join(lis)) elif flag == 2: for i in range(2): mi = min(lis[ans[i]] ,lis[l-1-ans[i]]) lis[ans[i]] = lis[l - 1 - ans[i]] = mi print("".join(lis)) elif flag == 0: for i in range(l // 2+1): if not lis[i] == 'a': lis[i] = lis[l - 1 - i] = 'a' break print("".join(lis))