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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; 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 < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 <cstdio>
#include <iostream>
#include <string>

using namespace std;

int main(void)
{
    char data[12][12];

    while (cin >> data[0]) {
        for (int i = 1; i < 8; i++) {
            cin >> data[i];
        }
        getchar();

        bool fl = false;
        for (int i = 0; i < 8; i++) {
            for (int j = 0; j < 8; j++) {
                if (data[i][j] == '1') {
                    if (data[i][j+1] == '1' &&
                            data[i+1][j+1] == '1' &&
                            data[i+1][j] == '1') {
                        puts("A");
                        fl = true;
                    } else if (data[i+1][j] == '1' &&
                            data[i+2][j] == '1' &&
                            data[i+3][j] == '1' ) {
                        puts("B");
                        fl = true;
                    } else if (data[i][j+1] == '1' && 
                            data[i][j+2] == '1' &&
                            data[i][j+3] == '1') {
                        puts("C");
                        fl = true;
                    } else if (data[i+1][j] == '1' && 
                            data[i+1][j-1] == '1' &&
                            data[i+2][j-1] == '1') {
                        puts("D");
                        fl = true;
                    } else if (data[i][j+1] == '1' && 
                            data[i+1][j+1] == '1' &&
                            data[i+1][j+2] == '1') {
                        puts("E");
                        fl = true;
                    } else if (data[i+1][j] == '1' && 
                            data[i+1][j+1] == '1' &&
                            data[i+2][j+1] == '1') {
                        puts("F");
                        fl = true;
                    } else if (data[i+1][j] == '1' && 
                            data[i][j+1] == '1' &&
                            data[i+1][j-1] == '1') {
                        puts("G");
                        fl = true;
                    }
                }
                if (fl) {
                    break;
                }
            }
            if (fl) {
                break;
            }
        }
    }

    return 0;
}

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

#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()

int main() {
  int dx[7][3] = {{0,1,1},{0,0,0},{1,2,3},{-1,-1,0},{1,1,2},{0,1,1},{-1,0,1} };
  int dy[7][3] = {{1,0,1},{1,2,3},{0,0,0},{1,2,1},{0,1,1},{1,1,2},{1,1,0} };

  char ba[8][8];
  while(cin>>ba[0][0]) {
    REP(i,8)
      REP(j,8)
        if (i!=0||j!=0)
          cin >> ba[j][i];
    int f = -1;
    REP(y,8) {
      REP(x,8) {
        if (ba[x][y] == '1') {
          REP(i,7) {
            int j = 0;
            for(;j<3;j++) {
              int xx = x + dx[i][j];
              int yy = y + dy[i][j];
              if (xx<0||8<=xx||yy<0||8<=yy) break;
              if (ba[xx][yy] != '1')
                break;
            }
            if (j==3) {
              f = i;
              break;
            }
          }
          if (f>=0) break;
        }
        if (f>=0) break;
      }
      if (f>=0) break;
    }
    cout << (char)('A' + f) << endl;
  }
}

C++: #include <iostream>
using namespace std;
char box[8][8];
char search(const int i,const int j){
	if(box[i][j+1]=='1' && box[i+1][j]=='1' && box[i+1][j+1]=='1') return('A'); 
	else if(box[i+1][j]=='1' && box[i+2][j]=='1' && box[i+3][j]=='1') return('B') ;
	else if(box[i][j+1]=='1' && box[i][j+2]=='1' && box[i][j+3]=='1') return('C') ;
	else if(box[i+1][j]=='1' && box[i+1][j-1]=='1' && box[i+2][j-1]=='1') return('D');
	else if(box[i][j+1]=='1' && box[i+1][j+1]=='1' && box[i+1][j+2]=='1') return('E');
	else if(box[i+1][j]=='1' && box[i+1][j+1]=='1' && box[i+2][j+1]=='1') return('F');
	else if(box[i][j+1]=='1' && box[i+1][j]=='1' && box[i+1][j-1]=='1') return('G'); 
	else return('0');
}

int main(){
	while(cin>>box[0][0]){
		for(int i=1;i<8;i++) cin >> box[0][i] ;
	char ans='0';bool flag=false;
	for(int i=1;i<8;i++)
		for(int j=0;j<8;j++) cin >> box[i][j] ;
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			if(box[i][j]=='0') continue;
			if(ans=='0' && box[i][j]=='1') ans=search(i,j);
		};
	};
	cout << ans << '\n' ;
	};
}

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	char table[8][9];

	while(scanf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",table[0],table[1],table[2],table[3],table[4],table[5],table[6],table[7])!=EOF){

		bool FLG = false;
		for(int i=0; i < 8; i++){
			for(int k=0; k<8; k++){
				if(table[i][k] == '1'){
					if(i <= 6 && k <= 6 && table[i][k+1] == '1' && table[i+1][k] == '1' && table[i+1][k+1] == '1'){
						printf("A\n");
						FLG = true;
						break;
					}else if(i <= 4 && table[i+1][k] == '1' && table[i+2][k] == '1' && table[i+3][k] == '1'){
						printf("B\n");
						FLG = true;
						break;
					}else if(k <= 4 && table[i][k+1] == '1' && table[i][k+2] == '1' && table[i][k+3] == '1'){
						printf("C\n");
						FLG = true;
						break;
					}else if(i <= 5 && k >= 1 && table[i+1][k-1] == '1' && table[i+1][k] == '1' &&
							table[i+2][k-1] == '1'){
						printf("D\n");
						FLG = true;
						break;
					}else if(i <= 6 && k <= 5 && table[i][k+1] == '1' && table[i+1][k+1] == '1' &&
							table[i+1][k+2] == '1'){
						printf("E\n");
						FLG = true;
						break;
					}else if(i <= 5 && k <= 6 && table[i+1][k] == '1' && table[i+1][k+1] == '1' &&
							table[i+2][k+1] == '1'){
						printf("F\n");
						FLG = true;
						break;
					}else if(i <= 6 && k <= 6 && k >= 1 && table[i][k+1] == '1' && table[i+1][k-1] == '1' &&
							table[i+i][k] == '1'){
						printf("F\n");
						FLG = true;
						break;
					}
				}
			}
			if(FLG)break;
		}
	}


	return 0;
}