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)
	}
}

Python: import sys
l=[t for t in sys.stdin]
i=0
while 1:
    pt=[i.find("1") for i in l[9*i:9*(i+1)] if i.find("1")!=-1]
    if not pt:break
    if len(pt)==1:print("C")
    elif len(pt)==2 and pt[0]==pt[1]:print("A")
    elif len(pt)==2 and pt[0]<pt[1]:print("E")
    elif len(pt)==2 and pr[0]>pt[1]:print("G")
    elif len(pt)==3 and pt[0]>pt[1]:print("D")
    elif len(pt)==3 and pt[0]<pt[1]:print("F")
    else: print("B")
    i+=1

Python: while True:
    lst = []
    try:
        for i in range(8):
            lst += list(map(int, input().split()))

        cnt = 0
        for i in range(len(lst)):
            if lst[i]:
                cnt += i
        cnt -= lst.index(1) * 4
    
        if cnt == 18:
            ans = "A"
        elif cnt == 48:
            ans = "B"
        elif cnt == 6:
            ans = "C"
        elif cnt == 34:
            ans = "D"
        elif cnt == 20:
            ans = "E"
        elif cnt == 34:
            ans = "F"
        else:
            ans = "G"
    
        print(ans)
    except:
        break

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(),input()
                    elif temp.index('1') == place : print('F')
                    else : print('D')
                elif onetwo == 2 :
                    if temp.index('1') == place : print('A')
                    elif temp.index('1') == place + 1 : print('E')
                    else : print('G')
    except : break

Python: # -*- coding: utf-8 -*-
figures = {
    'A': [['1', '1'], ['1', '1']],
    'B': [['1'], ['1'], ['1'], ['1']],
    'C': [['1', '1', '1', '1']],
    'D': [['0', '1'], ['1', '1'], ['1', '0']],
    'E': [['1', '1', '0'], ['0', '1', '1']],
    'F': [['1', '0'], ['1', '1'], ['0', '1']],
    'G': [['0', '1', '1'], ['1', '1', '0']],
}


def iter_input_lines():
    try:
        while True:
            yield [list(input()) for _ in range(8)]
    except EOFError:
        return StopIteration


def f1():
    for lines in iter_input_lines():
        f2(lines)


def f2(lines):
    for n, figure in figures.items():
        found = f3(lines, figure)
        if found:
            print(n)


def f3(lines, figure):
    height = len(figure)
    width = len(figure[0])
    for h in range(0, 8, height):
        for w in range(0, 8, width):
            found = f4(lines, figure, height, width, h, w)
            if found:
                return True
        
        
def f4(lines, figure, height, width, h, w):
    _figure = [[lines[h+_h][w+_w] for _w in range(width)] 
               for _h in range(height)]
    if figure == _figure:
        return True

Python: def trim(N):
    num=[]
    for x in range(8):
        for y in range(8):
            if N[y][x]=="1":
                if not num:
                    refer=(x,y)
                num.append((x,y))
    num=[(x-refer[0],y-refer[1]) for x,y in num]
    return num
def points(point):
    if point==[(0,0),(0,1),(1,0),(1,1)]:print("A")
    if point==[(0,0),(0,1),(0,2),(0,3)]:print("B")
    if point==[(0,0),(1,0),(2,0),(3,0)]:print("C")
    if point==[(0,0),(0,1),(1,-1),(1,0)]:print("D")
    if point==[(0,0),(1,0),(1,1),(2,1)]:print("E")
    if point==[(0,0),(0,1),(1,1),(1,2)]:print("F")
    if point==[(0,0),(1,-1),(1,0),(2,-1)]:print("G")
while True:
    try:
        N=[input() for _ in range(8)]
        points(trim(N))
    except:break

Python: def trim(N):
    num=[]
    for x in range(8):
        for y in range(8):
            if N[y][x]=="1":
                if not num:
                    refer=(x,y)
                num.append((x,y))
    num=[(x-refer[0],y-refer[1]) for x,y in num]
    return num
def points(point):
    if point==[(0,0),(0,1),(1,0),(1,1)]:print("A")
    if point==[(0,0),(0,1),(0,2),(0,3)]:print("B")
    if point==[(0,0),(1,0),(2,0),(3,0)]:print("C")
    if point==[(0,0),(0,1),(1,-1),(1,0)]:print("D")
    if point==[(0,0),(1,0),(1,1),(2,1)]:print("E")
    if point==[(0,0),(0,1),(1,1),(1,2)]:print("F")
    if point==[(0,0),(1,-1),(1,0),(2,-1)]:print("G")
while True:
    try:
        N=[input() for _ in range(8)]
        points(trim(N))
    except:break

Python: def get_input():
    while True:
        try:
            yield ''.join(input())
        except EOFError:
            break

N = list(get_input())
board = [[0 for i in range(11)] for j in range(11)]

for l in range(0, len(N), 9):
    for i in range(l, l+8):
        for j in range(len(N[i])):
            board[i-l][j] = int(N[i][j])
    ans = "X"
    for i in range(8):
        for j in range(8):
            if board[i][j] == 1:
                if board[i+1][j] == 1 and board[i][j+1] == 1 and board[i+1][j+1] == 1:
                    ans = "A"
                elif board[i+1][j] == 1 and board[i+2][j] == 1:
                    ans = "B"
                elif board[i][j+1] == 1 and board[i][j+2] == 1:
                    ans = "C"
                elif board[i][j+1] == 1 and board[i+1][j+1] == 1:
                    ans = "E"
                elif board[i+1][j] == 1 and board[i+1][j+1] == 1:
                    ans = "F"
                elif board[i][j+1] == 1:
                    ans = "G"
                else:
                    ans = "D"
                break
        if ans != "X":
            break
    print(ans)