import macros
import strutils
import sequtils
import sets

macro toTuple*(arr: auto, cnt: static[int]): auto =
  let t = genSym(); result = quote do: (let `t` = `arr`; ())
  for i in 0..<cnt: result[1].add(quote do: `t`[`i`])
template times*(n: int, body: untyped): untyped = (for _ in 0..<n: body)

proc getInt(): int =
  parseInt(readLine(stdin))

proc getInts(): seq[int] =
  readLine(stdin).split().map(parseInt)

proc main() =
  var s = stdin.readLine[0]
  var sharp = toHashSet(['A', 'C', 'D', 'F', 'G'])
  var key = "CDEFGABC"
  if sharp.contains(s):
    echo s, "#"
  else:
    echo key[key.find(s) + 1]


main()