import time S = input() start = time.time() S_list = list(S) size = len(S) if 'ai' == S[size-2]+S[size-1]: S_list[size-2] = 'A' S_list[size-1] = 'I' S_change = ''.join(S_list) print(S_change) else: S_change = S + '-AI' print(S_change) print('{} [ms]'.format(1000 * (time.time() - start)))