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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; 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 < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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: 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 f(_h, _w, flg):
    for h in range(8-_h+1):
        for w in range(8-_w+1):
            big = f1(h, w, _h, _w)
            if f2(big, flg):
                return True


def f1(s_h, s_w, _h, _w):
    big = []
    for h in range(_h):
        w_line = []
        for w in range(_w):
            w_line.append(maps[s_h+h][s_w+w])
        big.append(w_line)
    return big


def f2(big, flg):
    if flg == 'A':
        return bool(big == A)
    elif flg == 'B':
        return bool(big == B)
    elif flg == 'C':
        return bool(big == C)
    elif flg == 'D':
        return bool(big == D)
    elif flg == 'E':
        return bool(big == E)
    elif flg == 'F':
        return bool(big == F)
    elif flg == 'G':
        return bool(big == G)


def display():
    if f(2, 2, 'A'):
        print('A')
    elif f(4, 1, 'B'):
        print('B')
    elif f(1, 4, 'C'):
        print('C')
    elif f(3, 2, 'D'):
        print('D')
    elif f(2, 3, 'E'):
        print('E')
    elif f(3, 2, 'F'):
        print('F')
    elif f(2, 3, 'G'):
        print('G')

while True:
    try:
        maps = []
        for _ in range(8):
            maps.append(list(map(int, input())))
        display()
        input()
    except EOFError:
        break

Python: def get_data():
    array = []
    for i in range(8):
        array.append(input())
        
    return array
def judge():
    array = get_data()
    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*2 == p[2]:
                    print('G')
                else:
                    print('E')
while True:
    try:
        judge()
    except EOFError:
        break

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>

using namespace std;

typedef vector<int> vi;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<vb> vbb;
typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

#define all(a)  (a).begin(),(a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define pb push_back
#define mp make_pair

#define loop(i,a,b) for(int i=(a);i<ull(b);++i)
#define rep(i,n) loop(i,0,n)

const double eps = 1e-10;
const double pi  = acos(-1.0);
const double inf = (int)1e8;

int main(){
    string field[10];
    while(cin >> field[0]){
        rep(i, 7) cin >> field[i+1];
        rep(i, 10) field[i] += "00000000000000000000000";

        rep(i, 8){
            rep(j, 8){
                if(field[i][j] == '1' && field[i][j+1] == '1' && field[i+1][j] == '1' && field[i+1][j+1] == '1') cout << "A" << endl;
                else if(field[i][j] == '1' && field[i+1][j] == '1' && field[i+2][j] == '1' && field[i+3][j] == '1') cout << "B" << endl;
                else if(field[i][j] == '1' && field[i][j+1] == '1' && field[i][j+2] == '1' && field[i][j+3] == '1') cout << "C" << endl;
                else if(field[i][j+1] == '1' && field[i+1][j+1] == '1' && field[i+1][j] == '1' && field[i+2][j] == '1') cout << "D" << endl;
                else if(field[i][j] == '1' && field[i][j+1] == '1' && field[i+1][j+1] == '1' && field[i+1][j+2] == '1') cout << "E" << endl;
                else if(field[i][j] == '1' && field[i+1][j] == '1' && field[i+1][j+1] == '1' && field[i+2][j+1] == '1') cout << "F" << endl;
                else if(field[i+1][j] == '1' && field[i+1][j+1] == '1' && field[i][j+1] == '1' && field[i][j+2] == '1') cout << "G" << endl;
            }
        }
    }
}

C++: #include <iostream>
#include <string>

using namespace std;

char ret;

int main()
{

	while(cin){
	string s;
	
	for(int i=0;i<8;i++){
		string s_tmp;
		cin >>s_tmp;
		s += s_tmp;
	}
	// 2次元配列を1次元的に処理
	for(int i=0;i<8*8;i++){
		if(s[i]=='1'){
			// Aかどうか
			if(s[i+1]=='1' && s[i+8]=='1' && s[i+9]=='1'){
				ret = 'A';
				break;
			}else if(s[i+8]=='1' && s[i+16]=='1' && s[i+24]=='1'){
				ret = 'B';
				break;
			}else if(s[i+1]=='1' && s[i+2]=='1' && s[i+3]=='1'){
				ret = 'C';
				break;
			}else if(s[i+7]=='1' && s[i+8]=='1' && s[i+15]=='1'){
				ret = 'D';
				break;
			}else if(s[i+1]=='1' && s[i+9]=='1' && s[i+10]=='1'){
				ret = 'E';
				break;
			}else if(s[i+8]=='1' && s[i+9]=='1' && s[i+17]=='1'){
				ret = 'F';
				break;
			}else if(s[i+1]=='1' && s[i+7]=='1' && s[i+8]=='1'){
				ret = 'G';
				break;
			}
		}
	}
	}
	cout<<ret<<endl;
	return 0;
}