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<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
#include<queue>
#include<stack>
#include<set>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(int x){stringstream ss;ss<<x;return ss.str();}
char ta[12][12];
int main(){
while(true){
	int y,x;
	for(int i=0;i<12;i++)for(int j=0;j<12;j++)ta[i][j]='0';
	bool f=1;
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			char now;
			cin>>now;
			if(now==EOF){return 0;}
			if(now=='1'&&f){y=i,x=j;f=0;}
			ta[i][j]=now;
		}
	}
	if(ta[y][x+1]=='1'&&ta[y+1][x]=='1'&&ta[y+1][x+1]=='1')cout<<"A";
	
	else if(ta[y+1][x]=='1'&&ta[y+2][x]=='1'&&ta[y+3][x]=='1')cout<<"B";
	
	else if(ta[y][x+1]=='1'&&ta[y][x+2]=='1'&&ta[y][x+3]=='1')cout<<"C";
	
	else if(ta[y][x+1]=='1'&&ta[y+1][x+1]=='1'&&ta[y+1][x+2]=='1')cout<<"E";
	
	else if(ta[y+1][x]=='1'&&ta[y+1][x+1]=='1'&&ta[y+2][x+1]=='1')cout<<"F";
	
	else if(ta[y+2][x-1]=='1'&&ta[y+1][x]=='1'&&ta[y+1][x-1]=='1')cout<<"D";
	else cout<<"G";
	cout<<endl;
}
	
	return 0;
}

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

int b[8][8] = {{0}};  // b = block

    bool isA(int i, int j){
        if(i + 1 < 8 && j + 1 < 8){
            if(b[i][j] == 1 && b[i][j + 1] == 1 && b[i + 1][j] == 1 && b[i + 1][j + 1] == 1) 
                return true;
        }
        return false;
    }

    bool isB(int i, int j){
        if(i + 3 < 8 && j < 8){
            if(b[i][j] == 1 && b[i + 1][j] == 1 && b[i + 2][j] == 1 && b[i + 3][j] == 1)
                return true;
        }
        return false;
    }

    bool isC(int i, int j){
        if(i< 8 && j + 3 < 8){
            if(b[i][j] == 1 && b[i][j + 1] == 1 && b[i][j + 2] == 1 && b[i][j + 3] == 1)
                return true;
        }
        return false; 
    }

    bool isD(int i, int j){
        if(i + 2 < 8 && j - 1 >= 0){
            if(b[i][j] == 1 && b[i + 1][j] == 1 && b[i + 1][j - 1] == 1 && b[i + 2][j - 1] == 1)
                return true;
        }
        return false;
    }

    bool isE(int i, int j){
        if(i + 1 < 8 && j + 2 < 8){
            if(b[i][j] == 1 && b[i][j + 1] == 1 && b[i + 1][j + 1] == 1 && b[i + 1][j + 2] == 1)
                return true;
        }
        return false;
    }

    bool isF(int i, int j){
        if(i + 2 < 8 && j + 1 < 8){
            if(b[i][j] == 1 && b[i + 1][j] == 1 && b[i + 1][j + 1] == 1 && b[i + 2][j + 1] == 1)
                return true;
        }
        return false;
    }

    bool isG(int i, int j){
        if(i + 1 < 8 &&  j - 1 >= 0 && j + 1 < 8){
            if(b[i][j] == 1 && b[i][j + 1] == 1 && b[i + 1][j] == 1 && b[i + 1][j - 1] == 1)
                return true;
        }
        return false;
    }

int main(void){
    int i, j;

    string str;
    while(true) {
        for(i=0; i < 8; i++) {
            if(!(cin >> str)) {
                return 0;
            }
            for(j=0; j < 8; j++) {
                b[i][j] = str[j] == '1' ? 1 : 0;
                //cout << b[i][j]; 
            }
            //cout << endl;
        }
        for(i = 0; i < 8; i++){
            for(j = 0; j < 8; j++){
                //output
                if(b[i][j] == 1){
                    if(isA(i, j)) cout << "A" << endl;
                    if(isB(i, j)) cout << "B" << endl;
                    if(isC(i, j)) cout << "C" << endl;
                    if(isD(i, j)) cout << "D" << endl;
                    if(isE(i, j)) cout << "E" << endl;
                    if(isF(i, j)) cout << "F" << endl;
                    if(isG(i, j)) cout << "G" << endl;
                }  
            }
        }
    }

/**
    char b[8];
    std str;
    for(i = 0; i < 8; i++){
        cin >> b[i];
        str = std::to_string(b[i]);
    }
    for(i = 0; i < 8; i++){
        cout << str << endl;
    }*/
    

}

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

int main(){
  bool bmap[10][10];
  string s;
  for(int i=1;i<=8;i++){
    cin >> s;
    for(int j=0;j<s.length();j++){
      if(s[j] == '0')bmap[i][j+1] = false;
      else bmap[i][j+1] = true;
    }
  }
  for(int i=1;i<=8;i++){
    for(int j=1;j<=8;j++){
      if(bmap[i][j]){
	if(j+1<= 8 && i+1<=8 &&bmap[i][j+1] && bmap[i+1][j] && bmap[i+1][j+1]){
	  cout << "A" << endl; break;
	}
	else if(i+3<=8 && bmap[i+1][j] && bmap[i+2][j] && bmap[i+3][j]){
	  cout << "B" << endl; break;
	}
	else if(j+3<=8 && bmap[i][j+1] && bmap[i][j+2] && bmap[i][j+3]){
	  cout << "C" << endl; break;
	}
	else if(i+2<=8 && 1<=j-1 && bmap[i+1][j] && bmap[i+1][j-1] && bmap[i+2][j-1]){
	  cout << "D" << endl; break;
	}
	else if(i+1<=8 && j+2<=8 && bmap[i][j+1] && bmap[i+1][j+1] && bmap[i+1][j+2]){
	  cout << "E" << endl; break;
	}
	else if(i+1<=8 && 1<=j-1 && j+1<=8 && bmap[i][j+1] && bmap[i+1][j] && bmap[i+1][j-1]){
	  cout << "F" << endl; break;
	}
	else if(j+1<=8 && 1<=j-1 && j+1<=8 && bmap[i][j+1] && bmap[i+1][j] && bmap[i+1][j-1]){
	  cout << "G" << endl; break;
	}
      }
    }
  }
  return 0;
}