Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"reflect"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func scanBoard() [][]int {
	ret := make([][]int, 8)
	for k := range ret {
		ret[k] = make([]int, 8)
		for l := range ret[k] {
			ret[k][l] = 0
		}
	}
	for i := 0; i < 8; i++ {
		scanner.Scan()
		row := strings.Split(scanner.Text(), "")
		if reflect.DeepEqual(row, []string{}) {
			break
		}
		for j := 0; j < 8; j++ {
			ret[i][j], _ = strconv.Atoi(row[j])
		}
	}
	return ret
}

var emptyBoard = [][]int{{0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0}}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, emptyBoard) {
			break
		}
		// fmt.Println(board)
		for i := 0; i < 7; i++ {
			for j := 0; j < 7; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i][j+1] == 1 && board[i+1][j+1] == 1 {
					ans = "A"
				}
			}
		}
		for i := 0; i < 5; i++ {
			for j := 0; j < 8; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i+2][j] == 1 && board[i+3][j] == 1 {
					ans = "B"
				}
			}
		}
		for i := 0; i < 8; i++ {
			for j := 0; j < 5; j++ {
				if board[i][j] == 1 && board[i][j+1] == 1 && board[i][j+2] == 1 && board[i][j+3] == 1 {
					ans = "C"
				}
			}
		}
		for i := 0; i < 6; i++ {
			for j := 0; j < 7; j++ {
				if board[i][j+1] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 && board[i+2][j] == 1 {
					ans = "D"
				}
			}
		}
		for i := 0; i < 7; i++ {
			for j := 0; j < 6; j++ {
				if board[i][j] == 1 && board[i][j+1] == 1 && board[i+1][j+1] == 1 && board[i+1][j+2] == 1 {
					ans = "E"
				}
			}
		}
		for i := 0; i < 7; i++ {
			for j := 0; j < 6; j++ {
				if board[i][j+1] == 1 && board[i][j+2] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 {
					ans = "G"
				}
			}
		}
		for i := 0; i < 6; i++ {
			for j := 0; j < 7; j++ {
				if board[i][j] == 1 && board[i+1][j] == 1 && board[i+1][j+1] == 1 && board[i+2][j+1] == 1 {
					ans = "F"
				}
			}
		}
		fmt.Println(ans)
		fmt.Scanln()
	}
}

Python: while True : 
    try :
        temp = input()
        if temp == '00000000' or temp == '' : pass
        else :
            if '1111' in temp : print('C')
            else : 
                onetwo, place = temp.count('1'), temp.index('1')
                temp = input()
                if onetwo == 1 :
                    if temp.count('1') == 1 :
                        print('B')
                        input()
                    elif temp.index('1') == place : print('F')
                    else : print('D')
                    input()
                elif onetwo == 2 :
                    if temp.index('1') == place : print('A')
                    elif temp.index('1') == place + 1 : print('E')
                    else : print('G')
    except : break

Python: while True:
    try:
        cnt = 0
        for i in range(8):
            inp = input()
            if cnt == 1:
                if inp.count("1") == 1:
                    print("B")
                elif inp.index("1") == ind:
                    print("F")
                else:
                    print("D")
                cnt = -1
            elif cnt == 2:
                if inp.index("1") == ind:
                    print("A")
                elif inp.index("1") == ind + 1:
                    print("E")
                else:
                    print("G")
                cnt = -1
            elif cnt == 4:
                print("C")
                cnt = -1
            elif "1" in inp and cnt == 0:
                ind = inp.index("1")
                cnt = inp.count("1")
        inp = input()
    except:
        break

Python: while True:
    try:
        board=[[0 for i in range(14)],[0 for i in range(14)],[0 for i in range(14)]]
        for i in range(8):
            row=[0,0,0]+[int(j) for j in input()]+[0,0,0]
            board.append(row)
        board.append([0 for i in range(14)])
        board.append([0 for i in range(14)])
        board.append([0 for i in range(14)])

        for i in range(3,11):
            for j in range(3,11):
                if board[i][j]==0:
                    continue

                if board[i][j]==1 and board[i+1][j]==1 and board[i][j+1]==1 and board[i+1][j+1]==1:
                    block="A"
                elif board[i][j]==1 and board[i+1][j]==1 and board[i+2][j]==1 and board[i+3][j]==1:
                    block="B"
                elif board[i][j]==1 and board[i][j+1]==1 and board[i][j+2]==1 and board[i][j+3]==1:
                    block="C"
                elif board[i][j]==1 and board[i+1][j]==1 and board[i+1][j-1]==1 and board[i+2][j-1]==1:
                    block="D"
                elif board[i][j]==1 and board[i][j+1]==1 and board[i+1][j+1]==1 and board[i+1][j+2]==1:
                    block="E"
                elif board[i][j]==1 and board[i+1][j]==1 and board[i+1][j+1]==1 and board[i+2][j+1]==1:
                    block="F"
                elif board[i][j]==1 and board[i][j+1]==1 and board[i+1][j-1]==1 and board[i+1][j]==1:
                    block="G"
        print(block)
        input()


    except EOFError:
        break

Python: if __name__ == '__main__':

	while True:
		try:
			A = []

			for i in range(8):
				tmp = list(map(int,input()))
				if tmp.count(1) > 0:
					A.append(tmp)

			if len(A) == 1:
				print("C")
			elif len(A) == 4:
				print("B")
			else:
				if len(A) == 2:#A,E,G
					if A[0].index(1) < A[1].index(1):
						print("E")
					elif A[0].index(1) > A[1].index(1):
						print("G")
					else:
						print("A")
				elif len(A) == 3:#D,F
					if A[0].index(1) < A[2].index(1):
						print("F")
					else:
						print("D")
			input()

		except EOFError:
			break

Python: while True:
	try:
		x=[[int(i) for i in input()] for j in range(8)]
		count=0
		num=[]
		for i in range(8):
			if x[i].count(1)!=0:
				num.append(i)
				count+=1
		if count==1:
			print("C")
		elif count==4:
			print("B")
		elif count==2:
			for j in range(8):
				if x[num[0]][j]==1:
					if j==0:
						if x[num[0]+1][j]==1:
							print("A")
						else:
							print("E")
					else:
						if x[num[0]+1][j-1]==1:
							print("G")
						else:
							if x[num[0]+1][j]==1:
								print("A")
							else:
								print("E")
					break
		else:
			for j in range(8):
				if x[num[0]][j]==1:
					if j==0:
						print("F")
					else:
						if x[num[0]][j-1]==1:
							print("D")
						else:
							print("F")
					break
			
	except EOFError:
		break

Python: while True:
    try:
        mat = []
        for i in range(8):
            tmplst = list(input())
            mat.append(tmplst)
        
        a = []

        for j in mat:
            for k, num in enumerate(j):
                if num == '1':
                    a.append(k)

        if a[1] == a[0] +1:
            if a[2] == a[0] -1:
                print("G")
            elif a[2] == a[0]:
                print("A")
            elif a[2] == a[0] +1:
                print("E")
            else:
                print("C")

        else:
            if a[0] == a[3] +1:
                print("D")
            elif a[0] == a[3]:
                print("B")
            else:
                print("F")

        k = input()
    except EOFError:
        break