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
}

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)
	}
}

C++: #include<stdio.h>
int memo[4][2]={0};
char n;
int cou;
int main()
{
    while(1)
    {
        cou=0;
        for(int i=0;i<8;i++)
        {
            for(int j=0;j<9;j++)
            {
                if(scanf("%c",&n)!=EOF)
                {
                    if(n!='0'&&n!='\n')
                    {
                        memo[cou][0]=i;
                        memo[cou][1]=j;
                        cou++;
                    }
                }
                else return 0;
            }
        }
        if(memo[0][0]==memo[1][0])//A,C,E,G
        {
            if(memo[1][1]==memo[2][1]||memo[0][1]==memo[3][1])//E,G
            {
                if(memo[1][1]==memo[2][1])printf("E\n");
                else printf("G\n");
            }
            else//A,C
            {
                if(memo[0][0]==memo[3][0])printf("C\n");
                else printf("A\n");
            }
        }
        else//B,D,F
        {
            if(memo[0][1]==memo[3][1])printf("B\n");
            else//D,F
            {
                if(memo[0][1]==memo[1][1])printf("F\n");
                else printf("D\n");
            }
        }
    }
}

C++: #include <iostream>

using namespace std;

void solve()
{
	char F11;
	char Field[13][13];
	while(cin >> F11)
	{
		for(int i = 0; i < 13; ++i)
		{
			for(int j = 0; j < 13; ++j)
			{
				Field[i][j] = '2';
			}
		}
		Field[1][1] = F11;
		for(int i = 2; i < 9; ++i)
		{
			cin >> Field[1][i];
		}
		for(int i = 2; i < 9; ++i)
		{
			for(int j = 1; j < 9; ++j)
			{
				cin >> Field[i][j];
			}
		}
		for(int i = 1; i < 9; ++i)
		{
			for(int j = 1; j < 9; ++j)
			{
				if(Field[i][j] == '1')
				{
					if(Field[i][j + 1] == '1' && Field[i + 1][j] == '1' && Field[i + 1][j + 1] == '1')
					{
						cout << "A" << endl;
					}
					else if(Field[i + 1][j] == '1' && Field[i + 2][j] == '1' && Field[i + 3][j] == '1')
					{
						cout << "B" << endl;
					}
					else if(Field[i][j + 1] == '1' && Field[i][j + 2] == '1' && Field[i][j + 3] == '1')
					{
						cout << "C" << endl;
					}
					else if(Field[i + 1][j - 1] == '1' && Field[i + 1][j] == '1' && Field[i + 2][j - 1] == '1')
					{
						cout << "D" << endl;
					}
					else if(Field[i][j + 1] == '1' && Field[i + 1][j + 1] == '1' && Field[i + 1][j + 2] == '1')
					{
						cout << "E" << endl;
					}
					else if(Field[i + 1][j] == '1' && Field[i + 1][j + 1] == '1' && Field[i + 2][j + 1] == '1')
					{
						cout << "F" << endl;
					}
					else if(Field[i][j + 1] == '1' && Field[i + 1][j - 1] == '1' && Field[i + 1][j] == '1')
					{
						cout << "G" << endl;
					}
				}
			}
		}
	}
}

int main()
{
	solve();
	return(0);
}

C++: #include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
 
int xb[7][3] = {
        {1, 0, 1},
        {0, 0, 0},
        {1, 2, 3},
        {0, -1, -1},
        {1, 1, 2},
        {0, 1, 1},
        {1, 0, -1}
};
 
int yb[7][3] = {
        {0, 1, 1},
        {1, 2, 3},
        {0, 0, 0},
        {1, 1, 2},
        {0, 1, 1},
        {1, 1, 2},
        {0, 1, 1}
};
 
int main() {
        string field[8];
        while(getline(cin, field[0])) {
                for(int i = 1; i < 8; i++) getline(cin, field[i]);
 
                char ans = '\0';
                rep(y,8) {
                        rep(x,8) {
                                if(field[y][x] == '1') {
                                        // cerr << "x: " << x << " " << "y: " << y << endl;
                                        rep(i,8) {
                                                bool f = true;
                                                rep(j,3) {
                                                        int nx = xb[i][j];
                                                        int ny = yb[i][j];
                                                        if(0 <= nx && nx < 8 && 0 <= ny && ny < 8) {
                                                                if(field[y+ny][x+nx] != '1') {
                                                                        f = false;
                                                                        break;
                                                                }
                                                        }       
                                                }
                                                if(f) {
                                                        ans = 'A' + i;
                                                        goto END;
                                                }
                                        }
                                }
                        }
                }
        END:
                cout << ans << endl;
                getline(cin, field[0]);
        }
        return 0;
}