X = 'CDEFGABC' M = 'BE' S = input() if S in M: print(X[X.index(S) + 1]) else: print(S + '#')