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(), "")
		for j := 0; j < 8; j++ {
			ret[i][j], _ = strconv.Atoi(row[j])
		}
	}
	return ret
}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, [][]int{}) {
			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: def main():
    while True:
        try:
            Array = []
            for _ in range(8):
                Array.append(list(map(int,input().strip())))
                if 1 not in Array[-1]:
                 Array.pop()
            if len(Array) == 1:
                print('C')
            elif len(Array) == 2:
                if Array[0].index(1) == Array[1].index(1):
                    print('A')
                elif Array[0].index(1) < Array[1].index(1):
                    print('E')
                else:
                    print('G')
            elif len(Array) == 3:
                if Array[0].index(1) > Array[2].index(1):
                    print('D')
                else:
                    print('F')
            else:
                print('F')
        except EOFError:
            break

if __name__ == '__main__':
    main()

Python: shapes = {
    'A': '1100000011',
    'B': '1000000010000000100000001',
    'C': '1111',
    'D': '01000000110000001',
    'E': '11000000011',
    'F': '100000001100000001',
    'G': '0110000011'
}

while True:
    plane = ''
    for i in range(8):
        plane += input()

    for name in shapes:
        try:
            plane.index(shapes[name])
            print(name)
            break
        except:
            pass

Python: Figures = {"A": [[0, 1], [1, 0], [1, 1]],
           "B": [[1, 0], [2, 0], [3, 0]],
           "C": [[0, 1], [0, 2], [0, 3]],
           "D": [[1, -1], [1, 0], [2, -1]],
           "E": [[0, 1], [1, 1], [1, 2]],
           "F": [[1, 0], [1, 1], [2, 1]],
           "G": [[1, 0], [1, -1], [1, 0]]}
while True:
    try:
        k = [map(int, list(input())) for i in range(8)]
        l = [[y, x] for y,q in enumerate(k) for x,t in enumerate(q) if t]
        a, b = l[0]
        for i in range(4):
            l[i][0] -= a
            l[i][1] -= b
        for k, v in Figures.items():
            if l[1:] == v:
                print(k)
                break
        input()
    except:
        break

Python: while True : 
    try :
        switch = 0
        for _ in range(9) :
            if switch == 0 :
                temp = input()
                if temp == '00000000' or temp == '' : pass
                else :
                    onetwo, place = 0, 0
                    if '1111' in temp :
                        print('C')
                        switch = 1
                    else : onetwo, place = temp.count('1'), temp.index('1')

                    temp = input()
                    if onetwo == 1 :
                        if temp.count('1') == 1 : print('B')
                        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')
                    switch = 1
            else : input()
    except : break

Python: cont = 1
while(cont):
    a = []
    for i in range(8):
        a.append([int(i) for i in list(input())])
    try:
        _ = input()
    except EOFError:
        cont = 0
    ret = 1
    for i in range(8):
        if ret == 0:
            break
        for j in range(8):
            if ret == 0:
                break
            if a[i][j] == 1:
                ret = 0
                if j+1 < 8 and a[i][j+1] == 1:
                    if j+2 < 8 and a[i][j+2] == 1:
                        print("C")
                    else:
                        if j+2 < 8 and i+1 < 8 and a[i+1][j+2] == 1:
                            print("E")
                        elif i+1 < 8 and a[i+1][j+1] == 1:
                            print("A")
                        else:
                            print("G")
                else:
                    if i+1 < 8 and a[i+1][j] == 1:
                        if i+2 < 8 and a[i+2][j] == 1:
                            print("B")
                        else:
                            if j+1 < 8 and a[i+1][j+1] == 1:
                                print("F")
                            else:
                                print("D")

Python: ans = [0,0,0,"C",0,0,0,0,"G","A","E",0,0,0,0,"D",0,"F",0,0,0,0,0,0,"B"]
while(True):
    h = ""
    for _ in range(8):
        h +=input()
    print(ans[h.rfind("1")-h.find("1")])
    try:
        b =input()
    except:
        break

Python: import sys
readline = sys.stdin.readline
write = sys.stdout.write
B = [771, 16843009, 15, 66306, 1539, 131841, 774]
C = "ABCDEFG"
def solve():
    N = 8
    su = 0
    for i in range(N):
        s = readline().strip()
        for j in range(N):
            if s[j] == '1':
                su |= 1 << (i*N + j)
    for i in range(N*N):
        for k in range(7):
            b = B[k] << i
            if (su & b) == b:
                write("%s\n" % C[k])
    return True
try:
    while solve():
        readline()
except:
    ...

Python: def judge(array):
    count = [[0 for i in range(8)] for i in range(8)]
    for i in range(8):
        x = 0
        for j in array[i]:
            if int(j) == 1:
                count[i][x] += 1
            x += 1

    a = 0
    p = []
    for i in range(8):
        for j in range(8):
            if count[i][j] != 0:
                p.append(a)
            a += 1

    if p[0]+1 != p[1]:
        if p[0] + 8*3 == p[3]:
            print('B')
        else:
            if p[0] + 8*2 + 1 == p[3]:
                print('F')
            else:
                print('D')
    else:
        if p[0]+1 == p[1] and p[1]+1 == p[2]:
            print('C')
        else:
            if p[0] + 8 == p[2] and p[1] + 8 == p[3]:
                print('A')
            else:
                if p[0]+8 == p[3]:
                    print('G')
                else:
                    print('E')
                    
while True:
    try:
        array = []
        for i in range(8):
            array.append(input())
        judge(array)
        input()
    except:
        print('error')
        break