S = input() if S[-1] == 'i' and S[-2] == 'a': print(S[::-2] + 'AI') else: print(S + 'AI')