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++: //a
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef pair<double, int> stn;
typedef long long ll;

string ptn[7] = {	"1100110000000000",
					"1000100010001000",
					"1111000000000000",
					"0100110010000000",
					"1100011000000000",
					"1000110001000000"
					"0110110000000000"};

int main(){
	
	while(1){
		char ans = 0;
		string str;
		vector<string> surf = vector<string>(16, "0000000000000000");
		
		for(int i = 0; i < 8; ++i){
		
			if(cin.eof())
				return 0;
			
			cin >> str;
			surf[i] = str;
			
		}
		
		for(int y = 0; y < 8; ++y){
			for(int x = 0; x < 8; ++x){
				
				if(surf[y][x] == '1'){
					for(int k = 0; k < 7; ++k){
						
						int cnt = 0;
						
						for(int i = 0; i < 16; ++i){
							if( ptn[k][i] == surf[y+i/4][x+i%4] )
								cnt++;
							else
								break;
						}
						
						if(cnt>=16){
							ans = char('A'+k);
							goto out;
						}
						
					}
				}
				
			}
		}
		
		out:
			if(ans)
				cout << ans << endl;
	}
}

C++: #include <iostream>
#include <string>
#include <array>
#include <utility>
#include <algorithm>

using namespace std;

int main()
{
    array<pair<int, int> const, 4> const p[7] ={
        {{{0,0}, {1,0}, {0,1}, {1,1}}},
        {{{0,0}, {0,1}, {0,2}, {0,3}}},
        {{{0,0}, {1,0}, {2,0}, {3,0}}},
        {{{0,0}, {-1,1}, {0,1}, {-1,2}}},
        {{{0,0}, {1,0}, {1,1}, {2,1}}},
        {{{0,0}, {0,1}, {1,1}, {1,2}}},
        {{{0,0}, {1,0}, {-1,1}, {1,1}}},
    };

    string e;
    do {
        bool b[20][20] = {};
        int fx = 20, fy = 20;
        for( int y=0; y<8; ++y ) {
            for( int x=0; x<8; ++x ) {
                char c;
                cin >> c;
                b[4+x][4+y] = c == '1';
                if ( b[4+x][4+y] ) {
                    fx = min( fx, 4+x );
                    fy = min( fy, 4+y );
                }
            }
        }

        for( int i=0; i<7; ++i ) {
            if ( b[fx+p[i][0].first][fy+p[i][0].second]
                 && b[fx+p[i][1].first][fy+p[i][1].second]
                 && b[fx+p[i][2].first][fy+p[i][2].second]
                 && b[fx+p[i][3].first][fy+p[i][3].second]
                ) {
                cout << static_cast<char>( 'A' + i ) << endl;
                break;
            }
        }

    } while( getline( cin, e ) );
}

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

using namespace std;

char table[12][12]={0};

int main(void){
	int sx,sy;
	while(true){
		for(int y=1;y<=8;y++)
			for(int x=1;x<=8;x++)
				cin >> table[x][y],table[x][y]-='0';
		if(cin.eof())
			break;
		for(int y=1;y<=8;y++)
			for(int x=1;x<=8;x++)
				if(table[x][y])
					sx=x,sy=y,x=9,y=9;
		if(table[sx][sy]&table[sx+1][sy]&table[sx][sy+1]&table[sx+1][sy+1])
			cout << 'A' << endl;
		else if(table[sx][sy]&table[sx][sy+1]&table[sx][sy+2]&table[sx][sy+3])
			cout << 'B' << endl;
		else if(table[sx][sy]&table[sx+1][sy]&table[sx+2][sy]&table[sx+3][sy])
			cout << 'C' << endl;
		else if(table[sx][sy]&table[sx-1][sy+1]&table[sx][sy+1]&table[sx-1][sy+2])
			cout << 'D' << endl;
		else if(table[sx][sy]&table[sx+1][sy]&table[sx+1][sy+1]&table[sx+2][sy+1])
			cout << 'E' << endl;
		else if(table[sx][sy]&table[sx][sy+1]&table[sx+1][sy+1]&table[sx+1][sy+2])
			cout << 'F' << endl;
		else if(table[sx][sy]&table[sx+1][sy]&table[sx-1][sy+1]&table[sx][sy+1])
			cout << 'G' << endl;
	}
}

C++: #include<iostream>
#include<vector>
#include<array>
#include<string>
#include<sstream>
#define _X_ 0
#define _Y_ 1
int main()
{
	while (true)
	{
		std::vector<std::array<int, 2>>p;
		p.reserve(4);
		for (int i = 0; i < 8; i++)
		{
			std::string temp;
			std::cin >> temp;
			std::stringstream st(temp);
			for (int j = 0; j < 8; j++)
			{
				char foo;
				st >> foo;
				if (foo == '1')
				{
					p.push_back({ j, i });
				}
			}
		}
		if (std::cin.eof())
		{
			break;
		}
		if (p[0][_Y_] == p[1][_Y_])
		{
			if (p[0][_X_] == p[2][_X_])
			{
				std::cout << 'A' << std::endl;
			}
			else if (p[0][_Y_] == p[2][_Y_])
			{
				std::cout << 'C' << std::endl;
			}
			else if (p[1][_X_] == p[2][_X_])
			{
				std::cout << 'E' << std::endl;
			}
			else if (p[0][_X_] == p[3][_X_])
			{
				std::cout << 'G' << std::endl;
			}
		}
		else
		{
			if (p[0][_X_] == p[3][_X_])
			{
				std::cout << 'B' << std::endl;
			}
			else if (p[0][_X_] > p[3][_X_])
			{
				std::cout << 'D' << std::endl;
			}
			else
			{
				std::cout << 'F' << std::endl;
			}
		}
	}
	return 0;
}