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 < 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>
#include <stdio.h>
using namespace std;

int main(){
	int mass[8][8];
	
	BEGIN:
	while(scanf("%d%d%d%d%d%d%d%d",(*mass[0]),(*mass[0])+1,(*mass[0])+2,(*mass[0])+3,(*mass[0])+4,
		(*mass[0])+5,(*mass[0])+6,(*mass[0])+7)!=EOF)
	{
		for(int i=1;i<8;i++){
			scanf("%d%d%d%d%d%d%d%d",(*mass[i]),(*mass[i]+1),(*mass[i]+2),(*mass[i]+3),(*mass[i]+4),
				(*mass[i]+5),(*mass[i]+6),(*mass[i]+7));
		}
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(mass[i][j]){
					if(j==7){
						if(mass[i+1][j]){
							cout<<(mass[i+1][j-1]?"D\n":"B\n");
						}
					}else if(j==0){
						if(mass[i][j+1]){
							if(mass[i+1][j]) cout<<"A\n";
							else if(mass[i][j+2]) cout<<"C\n";
							else cout<<"E\n";
						}
						else cout<<(mass[i+1][j+1]?"F\n":"B\n");
					}else{
						if(mass[i][j+2]) cout<<"C\n";
						else if(mass[i][j+1]){
							if(mass[i+1][j]){
								cout<<(mass[i+1][j+1]?"A\n":"G\n");
							}
							else cout<<"E\n";
						}
						else if(mass[i+2][j]) cout<<"B\n";
						else cout<<(mass[i+1][j+1]?"F\n":"D\n");
					}
					goto BEGIN;
				}
			}
		}
	}
}

C++: #include<iostream>
#include<string>
using namespace std;
string str[8]; 
void ans(int i,int k){
	if(str[i][k+1] == '1' && str[i+1][k+1] == '1'&& str[i+1][k] == '1' ){
		cout << "A" << endl;  
		} else if(str[i+1][k] == '1' && str[i+2][k] == '1'&& str[i+3][k] == '1' ){
		cout << "B" << endl; 
		} else if(str[i][k+1] == '1' && str[i][k+2] == '1'&& str[i][k+3] == '1' ){
		cout << "C" << endl;  
		} else if(str[i+1][k] == '1' && str[i+1][k-1] == '1'&& str[i+2][k-1] == '1' ){
		cout << "D" << endl; 
		} else if(str[i][k+1] == '1' && str[i+1][k+1] == '1'&& str[i+1][k+2] == '1' ){
		cout << "E" << endl; 
		} else if(str[i+1][k] == '1' && str[i+1][k+1] == '1'&& str[i+2][k+1] == '1' ){
		cout << "F" << endl;  
		} else if(str[i][k+1] == '1' && str[i+1][k] == '1'&& str[i+1][k-1] == '1' ){
		cout << "G" << endl; 
		}



}

int main(){
	
	while(1){
	
	for(int i =0;i<8;i++)
		if(!(cin>>str[i]))return 0;
	
	
	for(int i=0;i<64;i++)
	
	if(str[i/8][i%8] == '1')
	ans(i/8,i%8);
	

	
	}
	
}

C++: #include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
using namespace std;
char fld[8][8];
int main(){
while(cin>>fld[0]){
    for(int i=1;i<8;i++){
        cin>>fld[i];
    }
    for(int i=0;i<8;i++){
        for(int j=0;j<8;j++){
            if(fld[i][j]=='1'){
                if(fld[i][j+1]=='1'&&fld[i+1][j]=='1'&&fld[i+1][j+1]=='1'){
                    cout<<'A'<<endl;
                }
                if(fld[i+1][j]=='1'&&fld[i+2][j]=='1'&&fld[i+3][j]=='1'){
                    cout<<'B'<<endl;
                }
                if(fld[i][j+1]=='1'&&fld[i][j+2]=='1'&&fld[i][j+3]=='1'){
                    cout<<'C'<<endl;
                }
                if(fld[i+1][j]=='1'&&fld[i+1][j-1]=='1'&&fld[i+2][j-1]=='1'){
                    cout<<'D'<<endl;
                }
                if(fld[i][j+1]=='1'&&fld[i+1][j+1]=='1'&&fld[i+1][j+2]=='1'){
                    cout<<'E'<<endl;
                }
                if(fld[i+1][j]=='1'&&fld[i+1][j+1]=='1'&&fld[i+2][j+1]=='1'){
                    cout<<'F'<<endl;
                }
                if(fld[i][j+1]=='1'&&fld[i+1][j]=='1'&&fld[i+1][j-1]=='1'){
                    cout<<'G'<<endl;
                }
            }
        }
    }
}
return 0;
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <algorithm>

using namespace std;

char Types(char x[12][11]);

int main () {
    char x[100];
    for(int i=0; i<100; i++){
        x[i]='0';
    }
    int flag = 1;

    while(flag){

        for(int i=0; i<64; i++){
            cin>>x[i];
            if(x[i]==EOF){
                flag=0;
                break;
            }
        }
        if(flag!=1){
            break;
        }
        
        int first;
        for(int i=0; i<64; i++){
            if(x[i]=='1'){
                first=i;
                break;
            }
        }
        
        if(x[first+1]=='1'){
            if(x[first+2]=='1'){
                cout<<"C"<<endl;
            }else if(x[first+7]=='1'){
                cout<<"G"<<endl;
            }else if(x[first+10]=='1'){
                cout<<"E"<<endl;
            }else{
                cout<<"A"<<endl;
            }
        }else{
            if(x[first+7]=='1'){
                cout<<"D"<<endl;
            }else if(x[first+9]=='1'){
                cout<<"F"<<endl;
            }else{
                cout<<"B"<<endl;
            }
        }
        
        
    }
    
    return 0;
}

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

int main(){
	bool flag = false;
	char s[80];
	int hit[4];
	int i, j, n;

	while(1){
		n = 0;
		for (i = 0; i < 8; i++) {
			if(scanf("%s", s) == EOF){
				flag = true;
				break;
			}
			for (j = 0; j < 8; j++) {
				if(s[j] == '1'){
					hit[n++] = i*8+j;
				}
			}
		}
		if(flag){
			break;
		}
		switch(hit[3] - hit[0]){
			case 9:
				cout << "A" << endl;
				break;
			case 24:
				cout << "B" << endl;
				break;
			case 3:
				cout << "C" << endl;
				break;
			case 15:
				cout << "D" << endl;
				break;
			case 10:
				cout << "E" << endl;
				break;
			case 17:
				cout << "F" << endl;
				break;
			case 8:
				cout << "G" << endl;
				break;
			default:
				cout << "ERROR:" << hit[4] - hit[0] << endl;
		}
	}
	return 0;
}