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)
		fmt.Scanln()
	}
}

C++: #include<iostream>
#include<string>
using namespace  std;

string table[8];
bool range(int y,int x)
{
	if (y < 0 || x < 0 || y >= 8 || x >= 8)return false;
	return true;
}
bool A(int y, int x)
{
	int dx[] = {0,1,1,0};
	int dy[] = {0,0,1,1};
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
bool B(int y, int x)
{
	int dx[] = { 0, 0, 0, 0 };
	int dy[] = { 0, 1, 2, 3 };
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
bool C(int y, int x)
{
	int dx[] = { 0, 1, 2, 3 };
	int dy[] = { 0, 0, 0, 0 };
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
bool D(int y, int x)
{
	int dx[] = { 0, 0, -1, -1 };
	int dy[] = { 0, 1,1, 2 };
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
bool E(int y, int x)
{
	int dx[] = { 0, 1, 1, 2 };
	int dy[] = { 0, 0, 1, 1 };
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
bool F(int y, int x)
{
	int dx[] = { 0, 0, 1, 1 };
	int dy[] = { 0, 1, 1, 2 };
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
bool G(int y, int x)
{
	int dx[] = { 0, 1, 0, -1 };
	int dy[] = { 0, 0, 1, 1 };
	for (int i = 0; i < 4; i++)
	{
		int ny = y + dy[i];
		int nx = x + dx[i];
		if (range(ny, nx) && table[ny][nx] == '1')continue;
		return false;
	}
	return true;
}
char check(int y, int x)
{
	if (A(y, x))return 'A';
	else if (B(y, x))return 'B';
	else if (C(y, x))return 'C';
	else if (D(y, x))return 'D';
	else if (E(y, x))return 'E';
	else if (F(y, x))return 'F';
	else if (G(y, x)) return 'G';
	else return 0;
}
int main()
{
	while (true)
	{
		for (int i = 0; i < 8; i++)
		{
			if (!(cin >> table[i]))return 0;
		}
		bool find = false;
		for (int i = 0; i < 8; i++)
		{
			for (int j = 0; j < 8; j++)
			{
				int ret = check(i,j);
				if (ret > 0)
				{
					find = true;
					cout << ((char)ret) << endl;
					break;
				}
			}
			if (find)break;
		}
	}
	return 0;
}

C++: #include<iostream>
#include<string>
using namespace std;

string b[11];
int solve(int i, int j){
    if(b[i][j+1]=='1'&&b[i+1][j]=='1'&&b[i+1][j+1]=='1') cout << 'A';
    else if(b[i+1][j]=='1'&&b[i+2][j]=='1'&&b[i+3][j]=='1') cout << 'B';
    else if(b[i][j+1]=='1'&&b[i][j+2]=='1'&&b[i][j+3]=='1') cout << 'C';
    else if(b[i][j+1]=='1'&&b[i+1][j+1]=='1'&&b[i+1][j+2]=='1') cout << 'E';
    else if(b[i+1][j]=='1'&&b[i+1][j+1]=='1'&&b[i+2][j+1]=='1') cout << 'F';
    else if(b[i+1][j-1]=='1'&&b[i+1][j]=='1'&&b[i+2][j-1]=='1') cout << 'D';
    else cout << 'G';
}
    
int main(){
    int i, j;
    char c;
    while(cin >> b[0]){
        b[0] += "000";
        for(int i=1;i<8;i++){
            cin >> b[i];
            b[i] += "000";
        }
        for(int i=8;i<11;i++){
            b[i] = "00000000000";
        }
        for(int i=0;i<64;i++){
            if(b[i/8][i%8] == '1'){
                solve(i/8, i%8);
                cout << endl;
                break;
            }
        }
    }
}

C++: #include<iostream>
#include<string>
using namespace std;

int main()
{
    while(true){
        int i=0;
        string map[8];
        while(cin>>map[i],!cin.eof()){
            i++;
            if(i==8){
                break;
            }
        }
        if(cin.eof()){
            break;
        }
        for(int i=0;i<8;i++){
            for(int j=0;j<8;j++){
                if(map[i][j]=='1' && map[i][j+1]=='1' && map[i+1][j]=='1' &&map[i+1][j+1]=='1'){
                    cout<<'A'<<endl;
                }
                else if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+2][j]=='1' &&map[i+3][j]=='1'){
                    cout<<'B'<<endl;
                }
                else if(map[i][j]=='1' && map[i][j+1]=='1' && map[i][j+2]=='1' &&map[i][j+3]=='1'){
                    cout<<'C'<<endl;
                }
                else if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+1][j-1]=='1' &&map[i+2][j-1]=='1'){
                    cout<<'D'<<endl;
                }
                else if(map[i][j]=='1' && map[i][j+1]=='1' && map[i+1][j+1]=='1' &&map[i+1][j+2]=='1'){
                    cout<<'E'<<endl;
                }
                else if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+1][j+1]=='1' &&map[i+2][i+1]=='1'){
                    cout<<'F'<<endl;
                }
                else if(map[i][j]=='1' && map[i][j-1]=='1' && map[i+1][j-1]=='1' &&map[i+1][j-2]=='1'){
                    cout<<'G'<<endl;
                }
            }
        }
    }
    return 0;
}