Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var scanner = bufio.NewScanner(os.Stdin)
	board := make([][]int, 8)
	for i := range board {
		board[i] = make([]int, 8)
			for j := range board[i] {
				board[i][j] = 0
			}
	}
	var ans string
	for scanner.Scan() {
		tmp := strings.Split(scanner.Text(), "")
		for i := 0; i < 8; i++ {
			board[0][i], _ = strconv.Atoi(tmp[i])
		}
		for i := 1; i < 8; i++ {
			scanner.Scan()
			row := strings.Split(scanner.Text(), "")
			for j := 0; j < 8; j++ {
				board[i][j], _ = strconv.Atoi(row[j])
			}
		}
		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>
using namespace std;

int main(){
    
    string str[10];
    
    while(cin >> str[0]){
        
        for(int i=1;i<8;i++){
            cin >> str[i];
        }
        
        for(int i=0;i<8;i++){
            for(int j=0;j<8;j++){
                
                if(i < 7 && j < 7){
                    if(str[i][j] == '1' && str[i][j+1] == '1' && str[i+1][j] == '1' && str[i+1][j+1] == '1'){
                        cout << 'A' << endl;
                    }
                }
                
                if(i < 5){
                    if(str[i][j] == '1' && str[i+1][j] == '1' && str[i+2][j] == '1'&& str[i+3][j] == '1'){
                        cout << 'B' << endl;
                    }
                }
                
                if(j == 0 && str[i].find("1111") != string::npos){
                    cout << 'C' << endl;
                }
                
                if(i < 6 && 0 < j){
                    if(str[i][j] == '1' && str[i+1][j-1] == '1' && str[i+1][j] == '1'&& str[i+2][j-1] == '1'){
                        cout << 'D' << endl;
                    }
                }
                
                if(i < 7 && j < 6){
                    if(str[i][j] == '1' && str[i][j+1] == '1' && str[i+1][j+1] == '1'&& str[i+1][j+2] == '1'){
                        cout << 'E' << endl;
                    }
                }
                
                if(i < 6 && j < 7){
                    if(str[i][j] == '1' && str[i+1][j] == '1' && str[i+1][j+1] == '1'&& str[i+2][j+1] == '1'){
                        cout << 'F' << endl;
                    }
                }
                
                if(i < 7 && 0 < j && j < 7){
                    if(str[i][j] == '1' && str[i][j+1] == '1' && str[i+1][j-1] == '1'&& str[i+1][j] == '1'){
                        cout << 'G' << endl;
                    }
                }
                
            }
        }
        
        
    }
    
    return(0);
}

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

int main(void) {
  string board[8];
  bool check;
  
  while(cin >> board[0]) {
    check = false;
    for(int i = 1; i < 8; ++i) {
      cin >> board[i];
    }
    for(int i = 0; i < 8; ++i) {
      for(int j = 0; j < 8; ++j) {
        if(board[i][j] == '1' && !check) {
          if(i <= 4 && board[i + 3][j] == '1') {
            cout << "B" << endl;
            check = true;
          } else if(j <= 4 &&  board[i][j + 3] == '1') {
            cout << "C" << endl;
            check = true;
          } else if(i <= 5 && j >= 1 && board[i + 2][j - 1] == '1') {
            cout << "D" << endl;
            check = true;
          } else if(i <= 6 && j <= 5 && board[i + 1][j + 2] == '1') {
            cout << "E" << endl;
            check = true;
          } else if(i <= 5 && j <= 6 && board[i + 2][j + 1] == '1') {
            cout << "F" << endl;
            check = true;
          } else if(i <= 6 && 1 <= j && j <= 6 &&board[i + 1][j - 1] == '1') {
            cout << "G" << endl;
            check = true;
          } else if(i <= 6 && j <= 6){
            cout << "A" << endl;
            check = true;
          }
        }
      }
    }
  }
  return 0;
}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <map>
#include <vector>
#include <stack>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

string mass[8];

char solve(int i, int j)
{
    if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i+1][j] == '1' && mass[i+1][j+1] == '1') {
        return 'A';
    }
    else if (mass[i][j] == '1' && mass[i+1][j] == '1' && mass[i+2][j] == '1' && mass[i+3][j] == '1') {
        return 'B';
    }
    else if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i][j+2] == '1' && mass[i][j+3] == '1') {
        return 'C';
    }
    else if (mass[i][j] == '1' && mass[i+1][j] == '1' && mass[i+1][j-1] == '1' && mass[i+2][j-1] == '1') {
        return 'D';
    }
    else if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i+1][j+1] == '1' && mass[i+1][j+2] == '1') {
        return 'E';
    }
    else if (mass[i][j] == '1' && mass[i+1][j] == '1' && mass[i+1][j+1] == '1' && mass[i+2][j+1] == '1') {
        return 'F';
    }
    else if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i-1][j] == '1' && mass[i-1][j-1] == '1') {
        return 'G';
    }
    
    return 0;
}

int main(void)
{
    char c;
    bool f;
    
    while (cin >> mass[0] >> mass[1] >> mass[2] >> mass[3] >> mass[4] >> mass[5] >> mass[6] >> mass[7]) {
        f = false;
        
        rep(i, 8) {
            rep(j, 8) {
                if (mass[i][j] == '1' && f == false) {
                    c = solve(i, j);
                    cout << c << endl;
                    f = true;
                }
            }
        }
    }
    
    return 0;
}

C++: #define	_USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cfloat>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <string>
#include <set>
using namespace std;
char s[100][100];
int main(){
	

	while(1){
		int x,y;
		bool f=false;
		for(int i=1;i<=8;i++){
			for(int j=1;j<=8;j++){
				cin>>s[i][j];
				if(s[i][j]=='1'&&!f){
					y=i;
					x=j;
					f=true;
				}
			}
		}
		
		if(s[y][x]=='1'&&s[y+1][x]=='1'&&s[y][x+1]=='1'&&s[y+1][x+1]=='1')
			cout<<"A"<<endl;
		else if(s[y][x]=='1'&&s[y+1][x]=='1'&&s[y+2][x]=='1'&&s[y+3][x]=='1')
			cout<<"B"<<endl;
		else if(s[y][x]=='1'&&s[y][x+1]=='1'&&s[y][x+2]=='1'&&s[y][x+3]=='1')
			cout<<"C"<<endl;
		else if(s[y][x]=='1'&&s[y+1][x]=='1'&&s[y+1][x-1]=='1'&&s[y+2][x-1]=='1')
			cout<<"D"<<endl;
		else if(s[y][x]=='1'&&s[y][x+1]=='1'&&s[y+1][x+1]=='1'&&s[y+1][x+2]=='1')
			cout<<"E"<<endl;
		else if(s[y][x]=='1'&&s[y+1][x]=='1'&&s[y+1][x+1]=='1'&&s[y+2][x+1]=='1')
			cout<<"F"<<endl;
		else if(s[y][x]=='1'&&s[y][x+1]=='1'&&s[y+1][x]=='1'&&s[y+1][x-1]=='1')
			cout<<"E"<<endl;
		
	}
}