s = "CDEFGABC" S = input() if "ACDFG".__contains__(S): print(f"{S}#") else: print(s[s.index(S) + 1])