s = input() k = list("CDEFGABC") if s in "ACDFG": print(s + "#") else: print(k[k.index(s) + 1])