import re

while True:

    try:

        s = ''.join([input() for s in range(8)])

        print('    C    GAE    D F      B'[len(re.findall('1.*1', s)[0])])

        input()

    except EOFError:

        break
import sys;import re

for s in sys.stdin.read().split('\n\n'):print('    C    GAE    D F      B'[len(re.findall('1.*1', s.replace('\n',''))[0])])
import re

while True:
    try:
        s = "".join([input() for s in range(8)])
        print("    C    GAE    D F      B"[len(re.findall("1.*1", s)[0])])
        input()
    except EOFError:
        break

import sys
import re

for s in sys.stdin.read().split("\n\n"):
    print("    C    GAE    D F      B"[len(re.findall("1.*1", s.replace("\n", ""))[0])])

+import sys -while True: -    try: -        s = "".join([input() for s in range(8)]) -        print("    C    GAE    D F      B"[len(re.findall("1.*1", s)[0])]) -        input() -    except EOFError: -        break +for s in sys.stdin.read().split("\n\n"): +    print("    C    GAE    D F      B"[len(re.findall("1.*1", s.replace("\n", ""))[0])])