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 <iostream>

#define limit(A,X,C) ((X<A)?A:(C<X)?C:X)

char map[8+1][8]={'0'};

int pget(int x,int y)
{
	if(limit(0,x,7)==x && limit(0,y,7)==y)
		return map[y][x]-'0';
	return 0;
}

char check(int x, int y)
{
	std::cout << ":" << x << y << std::endl;
	if(pget(x+1,y))
	{
		if(pget(x+2,y))
			return 'C';
		if(!pget(x,y+1))
			return 'E';
		if(pget(x+1,y+1))
			return 'A';
		return 'G';
	}
	if(pget(x,y+2))
		return 'B';
	if(pget(x+1,y+2))
		return 'F';
	return 'D';
}

int main(void)
{
	do
	{
		for(int i=0; i<8; i++)
			if(!(std::cin >> map[i]))
				return 0;
		int x,y;
		bool end=false;
		for(y=0; y<8; y++)
		{
			for(x=0; x<8; x++)
				if(map[y][x] == '1')
				{
					end=true;
					break;
				}
			if(end)
				break;
		}

		std::cout << check(x,y) << std::endl;
	}while(std::cin.getline(map[0],sizeof(map[0])));
	
	return 0;
}

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

using namespace std;

char ret;

int main()
{

	while(!cin.eof()){
	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;
}

C++: #include<bits/stdc++.h>
using namespace std;
int main(){
	char input[8][8];
	int line;
	int zero;
	int tmp;
	bool flag;
	bool is,end;
	while(gets(input[0])){
		for(int i=1;i<8;i++)
			gets(input[i]);
		line=0;
		zero=0;
		flag=false;
		end=false;
		for(int i=0;i<8;i++){
			is=false;
			for(int j=0;j<8;j++){
				if(input[i][j]=='1'){
					is=true;
					flag=true;
					if(zero)
						end=true;
				}
				if(flag&&!end){
					if(input[i][j]=='0')
						zero++;
				}	
			}
			if(is)
				line++;
		}
		if(line==4)
			cout<<"B"<<endl;
		else if(line==1)
			cout<<"C"<<endl;
		else if(line==2){
			if(zero==6)
				cout<<"A"<<endl;
			else if(zero==7)
				cout<<"E"<<endl;
			else if(zero==5)
				cout<<"G"<<endl;
		}else{
			if(zero==7)
				cout<<"F"<<endl;
			else
				cout<<"D"<<endl;
		}
		getchar();
	}
}

C++: #include<iostream>
#include<vector>
int main(){
	std::vector<std::vector<int> > vec(8,std::vector<int>(8));
	while(1){
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				std::cin>>vec[i][j];
			}
		}
		if(std::cin.eof())break;
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(vec[i][j]==1){
					if(vec[i][j+1]==1&&vec[i+1][j]==1&&vec[i+1][j+1]==1)std::cout<<"A"<<std::endl;
					if(vec[i+1][j]==1&&vec[i+2][j]==1&&vec[i+3][j]==1)std::cout<<"B"<<std::endl;
					if(vec[i][j+1]==1&&vec[i][j+2]==1&&vec[i][j+3]==1)std::cout<<"C"<<std::endl;
					if(vec[i+1][j]==1&&vec[i+1][j-1]==1&&vec[i+2][j-1]==1)std::cout<<"D"<<std::endl;
					if(vec[i][j+1]==1&&vec[i+1][j+1]==1&&vec[i+1][j+2]==1)std::cout<<"E"<<std::endl;
					if(vec[i+1][j]==1&&vec[i+1][j+1]==1&&vec[i+2][j+1]==1)std::cout<<"F"<<std::endl;
					if(vec[i][j+1]==1&&vec[i+1][j]==1&&vec[i+1][j-1]==1)std::cout<<"G"<<std::endl;
				}
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>

#define rep(i,j,k) for(int i=j;i<k;i++)
#define drep(n,m) for(int i=0;i<n;i++)for(int j=0;j<m;j++)
#define Sort(x) sort((x).begin(),(x).end())
#define fi first
#define se second
#define vi vector<int>
#define INF 1000000000
#define MOD 1000000009
#define pb push_back
#define mp make_pair
typedef long long ll;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

ll gcd(ll a,ll b){
    if(a<b){
        int t=a;a=b;b=t;
    }
    int c=a%b;
    while(c!=0){
        a=b;
        b=c;
        c=a%b;
    }
    return b;
}

ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}

bool isPrime(int x){
    if(x==1)return false;
    if(x==2)return true;
    if(x%2==0)return false;
    for(int i=3;i<=sqrt(x);i+=2){
        if(x%i==0)return false;
    }
    return true;
}

int kaizyo(int x){
    if(x==1)return x;
    else return x*kaizyo(x-1);
}


int main() {
    vector<vector<char>> v(8,vector<char>(8));
    while(cin>>v[0][0]){
        rep(i,1,8)cin>>v[0][i];
    rep(i,1,8)rep(j,0,8)cin>>v[i][j];
    rep(i,0,8){
        rep(j,0,8){
            if(v[i][j]=='1'){
                //cout<<9<<endl;
                if(v[i][j+1]=='1'&&v[i+1][j]=='1'&&v[i+1][j+1]=='1'){cout<<"A"<<endl;goto AWAY;}
                if(v[i+1][j]=='1'&&v[i+1][j-1]=='1'&&v[i+2][j-1]=='1'){cout<<"D"<<endl;goto AWAY;}
                if(v[i][j+1]=='1'&&v[i+1][j+2]=='1'&&v[i+1][j+1]=='1'){cout<<"E"<<endl;goto AWAY;}
                if(v[i][j+1]=='1'&&v[i+2][j+1]=='1'&&v[i+1][j+1]=='1'){cout<<"F"<<endl;goto AWAY;}
                if(v[i][j+1]=='1'&&v[i+1][j]=='1'&&v[i+1][j-1]=='1'){cout<<"G"<<endl;goto AWAY;}
                if(v[i+3][j]=='1'){cout<<"B"<<endl;goto AWAY;}
                if(v[i][j+3]=='1'){cout<<"C"<<endl;goto AWAY;}
            }
        }
    }
    AWAY:;
    v.clear();
    //v.resize(8,vector<int>(8));
    }
    return 0;
}