import sys

data = sys.stdin.read().strip()

records = data.split(">")[1:]

highest_gc = 0
highest_id = ""

for record in records:
    lines = record.splitlines()

    dna_id = lines[0]
    dna = "".join(lines[1:])

    c = dna.count("C")
    g = dna.count("G")

    gc_content = ((c + g) / len(dna)) * 100

    if gc_content > highest_gc:
        highest_gc = gc_content
        highest_id = dna_id

print(highest_id)
print(highest_gc)