Go: package main

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

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var scanner = bufio.NewScanner(os.Stdin)
	board := make([][]int, 8)
	for i := range board {
		board[i] = make([]int, 8)
			for j := range board[i] {
				board[i][j] = 0
			}
	}
	var ans string
	for scanner.Scan() {
		tmp := strings.Split(scanner.Text(), "")
		for i := 0; i < 8; i++ {
			board[0][i], _ = strconv.Atoi(tmp[i])
		}
		for i := 1; i < 8; i++ {
			scanner.Scan()
			row := strings.Split(scanner.Text(), "")
			for j := 0; j < 8; j++ {
				board[i][j], _ = strconv.Atoi(row[j])
			}
		}
		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: maxl = 8

offsetV = ('A', 'B', 'C', 'D', 'E', 'F', 'G')
offset = (((0, 1), (1, 0), (1, 1)),
          ((0, 1), (0, 2), (0, 3)),
          ((1, 0), (2, 0), (3, 0)),
          ((0, 1), (-1, 1), (-1, 2)),
          ((1, 0), (1, 1), (2, 1)),
          ((0, 1), (1, 1), (1, 2)),
          ((1, 0), (-1, 1), (0, 1)),
          )


def match(l, x, y, oi):
    for offX, offY in [a for a in offset[oi]]:
        if 0 <= x + offX  <= maxl and 0 <= y + offY < maxl:
            pass
        else:
            return False

        if l[y + offY][x + offX] == '0':
            return False
    return True


def solve():
    l = [input() for i in range(9)]
    for y in range(7):
        for x in range(7):
            if l[y][x] == '1':
                for o in range(7):
                    if match(l, x, y, o):
                        return offsetV[o]



try:
    while 1:
        print(solve())
except:
    pass

Python: def block(b):
    for i in range(8):
        for j in range(8):
            if b[i][j] == 1:
                if sum(b[i]) == 4:
                    return 'C'
                if sum([b[t][j] for t in range(8)]) == 4:
                    return 'B'
                if sum(b[i]) == 2:
                    if b[i + 1][j] == 0:
                        return 'E'
                    if b[i + 1][j + 1] == 0:
                        return 'G'
                    return 'A'
                if j > 0 and b[i + 1][j - 1] == 1:
                    return 'D'
                return 'F'

while True:
    try:
        b = 8 * [8 * [0]]
        for i in range(8):
            b[i] = list(map(int, input()))
        print(block(b))
        input()
    except:
        break

Python: import sys


def analyze_figure(data):
    """
    ??????????????????????????§?????????????????£???????????????'1'????????£?????????????????¢??????
    ??????????????¨????????¶??????????????¢??????????????????
    """
    for i, row in enumerate(data):
        if '1' not in row:
            continue
        dot = row.count('1')
        if dot == 1:  # B, D, F???????????????
            x = row.index('1')
            try:
                if data[i+2][x] == '1':
                    return 'B'
                elif data[i+1][x+1] == '1':
                    return 'F'
                else:
                    return 'D'
            except IndexError:
                return None
        else:  # A, C, E, G???????????????
            x = row.index('1')
            try:
                if data[i][x+2] == '1':
                    return 'C'
                elif data[i+1][x] == '0':
                    return 'E'
                elif data[i+1][x+1] == '1':
                    return 'A'
                else:
                    return 'G'
            except IndexError:
                return None


if __name__ == '__main__':
    data = []
    for line in sys.stdin:
        data.append(line.strip())
        # data.append('00000000')
        # data.append('00000000')
        # data.append('00000000')
        # data.append('00000000')
        # data.append('00000000')
        # data.append('00000000')
        # data.append('00000000')
        # data.append('00000000')


        # ???????????????
        if len(data) == 8:
            ans = analyze_figure(data)

            # ???????????¨???
            if ans:
                print(ans)
            data = []

Python: while 1:
 a=[list(map(int,input()))for _ in[0]*8]
 y=[sum(r)for r in a]
 x=[sum(c)for c in zip(*a)]
 print('B'if 4 in x else'C'if 4 in y else'DF'[a[y.index(1)][x.index(2)]]if 1 in y else'GE'[a[y.index(2)][x.index(1)]]if 1 in x else'A')
 try:input()
 except:break

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: import sys

counter = 0
block = []
for line in sys.stdin:
  if line == "\n":
    counter = -1
    block = []
  else:
    counter += 1
    for i in line:
      if i == "1":
        block.append([counter,line.index(i)])
  if counter == 7:
    if block[0][0] == block[1][0]:
      if block[1][0] == block[2][0]:
        print("C")
      elif block[0][1] == block[2][1]:
        print("A")
      elif block[0][1] < block[2][1]:
        print("E")
      else:
        print("G")
    else:
      if block[0][1] == block[3][1]:
        print("B")
      elif block[0][1] < block[3][1]:
        print("F")
      else:
        print("D")

Python: while True:
  vv = []
  for i in range(8):
    v = [int(e) for e in list(input())]
    vv.append(v)
  for index in reversed(range(len(vv))):
    t = all(x == 0 for x in vv[index])
    #print(t)
    if t == True:
      vv.pop(index)
  height = len(vv)
  for i in reversed(range(len(vv[0]))):
    aa = [vv[h][i] for h in range(height)]
    aa = all([ a==0 for a in aa ])
    if aa == True:
      for h in range(height): 
        del vv[h][i]
  #  print(aa)
  #print(vv)
  obj = { '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]] } 
  #print(obj)
  for k, v in obj.items():
    if v == vv:
      print(k)
      break
  try:
    input()
  except:
    break