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: # -*- coding: utf-8 -*-

import sys
import os

d = {}
d['A'] = ['11', '11']
d['B'] = ['1', '1', '1', '1']
d['C'] = ['1111']
d['D'] = ['01', '11', '10']
d['E'] = ['110', '011']
d['F'] = ['10', '11', '01']
d['G'] = ['011', '110']

DEBUG = False

A = []
for s in sys.stdin:
    s = s.strip()
    if s == '':
        continue

    A.append(s)

    if len(A) == 8:
        # solve
        # ...
        answer = None

        for key in d.keys():
            figure = d[key]
            W = len(figure[0])
            H = len(figure)

            for x in range(8 - W + 1):
                for y in range(8 - H + 1):
                    # check
                    is_fit = True
                    for i, row in enumerate(figure):
                        if not row == A[y+i][x:x+W]:
                            is_fit = False
                            break
                    if is_fit:
                        if DEBUG:
                            print()
                            print('all fit', key)
                            print('A', A)
                            print('x, y', x, y)
                            print('W, H', W, H)
                            print('figure', figure)
                        answer = key
        print(answer)
        A = []

Python: def match(a,b):
    for i in range(len(b)):
        if a == b[i:i+len(a)]:
            return(True)
    return(False)

pat = {'A':[1,1]+[0]*6+[1,1],
       'B':([1]+[0]*7)*3+[1],
       'C':[1]*4,
       'D':[1]+[0]*6+[1,1]+[0]*6+[1],
       'E':[1,1]+[0]*7+[1,1],
       'F':[1]+[0]*7+[1,1]+[0]*7+[1],
       'G':[1,1]+[0]*5+[1,1]}

while True:
    try:
        pla = []
        for _ in range(8):
            l = input().strip()
            pla += map(int,list(l))

        for i in ['A','B','C','D','E','F','G']:
            if match(pat[i],pla):
                print(i)
        input()
    except EOFError:
        break

Python: # coding: utf-8
# Your code here!

input_lines = int(input())
for i in range(input_lines):
  s = input().rstrip().split("\n")
 
#for i range 8:
    

print (s)

Python: inputs = int(input())
for i in range(inputs):
  s = i
 
#for i range 8:
    

print (s)

Python: from functools import lru_cache

@lru_cache(maxsize=None) 
def check(data):   
        if A in data:
                print("A")
        elif B in data:
                print("B")
        elif C in data:
                print("C")
        elif D in data:
                print("D")
        elif E in data:
                print("E")
        elif F in data:
                print("F")
        elif G in data:
                print("G")
                

A = '1'*2 + '0'*6 +'1'*2
B = '1' + '0'*7 + '1' + '0'*7 + '1' + '0'*7 + '1'
C = '1'*4
D = '1' + '0'*6 +'1'*2 + '0'*6 +'1'
E = '1'*2 + '0'*7 + '1'*2
F = '1' + '0'*7 + '1'*2 + '0'*7 +'1'
G = '1'*2 + '0'*5 +'1'*2

while True: 
        data = ''.join(map(lambda x: input(), range(8)))
        check(data)
        try: input()
        except: break

Python: ans = {"1100000011": "A", "1000000010000000100000001": "B",
       "1111": "C", "1000000110000001": "D",
       "11000000011": "E", "100000001100000001": "F", "0110000011": "G"}
while True:
    try:
        st = ""

        for i in range(8):
            st += input()

        for k, v in ans.items():
            if st.find(k) != -1:
                print(v)
                break
    except:
        break

Python: import sys

for s in sys.stdin:
    a_b = True
    for i in range(8):
        for j in range(8):
            ss = s.splitlines()[i][j]
            if int(ss) == 1 and a_b:
                a_b, a_v = False, (i, j)
            if int(ss) == 1 and not a_b:
                z_v = (i, j)
    if a_v[0]+1==z_v[0] and a_v[1]+1==z_v[1]:
        print("A")
    elif a_v[0]+3==z_v[0] and a_v[1]==z_v[1]:
        print("B")
    elif a_v[0]==z_v[0] and a_v[1]+3==z_v[1]:
        print("C")
    elif a_v[0]+2==z_v[0] and a_v[1]-1==z_v[1]:
        print("D")
    elif a_v[0]+1==z_v[0] and a_v[1]+2==z_v[1]:
        print("E")
    elif a_v[0]+2==z_v[0] and a_v[1]+1==z_v[1]:
        print("F")
    else:
        print("G")

Python: s = []
while True:
    try:
        s = [input() for _ in range(8)]
    except:
        break
    a_b = True
    for i in range(8):
        for j in range(8):
            ss = s[i][j]
            if int(ss) == 1 and a_b:
                a_b, a_v = False, (i, j)
            if int(ss) == 1 and not a_b:
                z_v = (i, j)
    if a_v[0]+1==z_v[0] and a_v[1]+1==z_v[1]:
        print("A")
    elif a_v[0]+3==z_v[0] and a_v[1]==z_v[1]:
        print("B")
    elif a_v[0]==z_v[0] and a_v[1]+3==z_v[1]:
        print("C")
    elif a_v[0]+2==z_v[0] and a_v[1]-1==z_v[1]:
        print("D")
    elif a_v[0]+1==z_v[0] and a_v[1]+2==z_v[1]:
        print("E")
    elif a_v[0]+2==z_v[0] and a_v[1]+1==z_v[1]:
        print("F")
    else:
        print("G")

Python: #"1"の座標を、最初のものを(0,0)として切り出し
def trim(mp):
  ret = []

  for x in range(8):
    for y in range(8):
      if mp[y][x] == "1":
        if not ret:
          refer = (x, y)
        ret.append((x, y))

  ret = [(x - refer[0], y - refer[1]) for x, y in ret]
  return ret

#座標が一致したものを出力
def put_ans(points):
  if points == [(0, 0), (0, 1), (1, 0), (1, 1)]: print("A")
  if points == [(0, 0), (0, 1), (0, 2), (0, 3)]: print("B")
  if points == [(0, 0), (1, 0), (2, 0), (3, 0)]: print("C")
  if points == [(0, 0), (0, 1), (1, 0), (1, -1)]: print("D")
  if points == [(0, 0), (1, 0), (1, 1), (2, 1)]: print("E")
  if points == [(0, 0), (0, 1), (1, 1), (1, 2)]: print("F")
  if points == [(0, 0), (1, -1), (1, 0), (2, -1)]: print("G")

while True:
  mp = [input() for _ in range(8)]
  put_ans(trim(mp))
  try:
    input()
  except EOFError:
    break