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>
using namespace std;

int main(){
	int k, l, a[11][11] = {};
	string in[8], mm;
	while (true)
	{
		for (int i=0;i<8;i++){
			cin >> in[i];
		}
		if (cin.eof()) { break; }

		for (k = 0; k<8; k++) {
			for (l = 0; l<8; l++) {
				mm = in[k][l];
				a[k][l] = stoi(mm);
			}
		}
		for (k = 0; k<8; k++) {
			int z = false;
			for (l = 0; l<8; l++) {
				if(1 ==a[k][l]){
					z = true;
					break;
				}
			}
			if (z) { break; }
		}
		if (a[k + 3][l] == 1) { cout << "B" << endl; }
		else if (a[k][l+3] == 1) { cout << "C" << endl; }
		else if (a[k+1][l + 2] == 1) { cout << "E" << endl; }
		else if (a[k+2][l + 1] == 1) { cout << "F" << endl; }
		else if (a[k+1][l + 1] == 1) { cout << "A" << endl; }
		else if (a[k+2][l - 1] == 1) { cout << "D" << endl; }
		else { cout << "G" << endl; }
	}
	return 0;
}

C++: #include <iostream>

using namespace std;

int main()
{
	char field[8][8];
	char tmp;
	int i,j;
	while(1){
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				cin >> field[i][j];
			}
		}
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				if(field[i][j]=='1')goto NEXT;
			}
		}
		NEXT:
			//横一列
			if(j+3<=7&&field[i][j+1]=='1'&&field[i][j+2]=='1'&&field[i][j+3]=='1')
				cout<<"C"<<endl;
			//縦一列
			else if(i+3<=7&&field[i+1][j]=='1'&&field[i+2][j]=='1'&&field[i+3][j]=='1')
				cout<<"B"<<endl;
			//正方形
			else if(j+1<=7&&i+1<=7&&field[i][j+1]=='1'&&field[i+1][j]=='1'&&field[i+1][j+1]=='1')
				cout<<"A"<<endl;
			/*1 0
				1 1
				0 1*/
			else if(i+2<=7&&j+1<=7&&field[i+1][j]=='1'&& field[i+1][j+1]=='1'&&field[i+2][j+1]=='1')
				cout<<"F"<<endl;
			/*0 1 1
				1 1 0*/
			else if(j-1>=0&&j+1<=7&&i+1<= 7&&field[i][j+1]=='1'&&field[i+1][j]=='1'&&field[i+1][j-1]=='1')
				cout<<"G"<<endl;
			/*1 1 0
				0 1 1*/
			else if(j+2<=7&&i+1<=7&&field[i][j+1]=='1'&&field[i+1][j+1]=='1'&&field[i+1][j+2]=='1')
				cout<<"E"<<endl;
			else cout<<"D"<<endl;
			cin.clear();
			cin.ignore();
			if(cin.eof())return 0;
		}
	return 0;
}

C++: 
#include<iostream>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
int main(void){
  char maze[9][9];
  while(true){
    rep(i,8)rep(j,8)cin>>maze[i][j];
    if(cin.eof())break;
    bool used = false;
    rep(y,8){
      rep(x,8){
	if (maze[y][x] == '1') {
	  if (maze[y][x+1] == '1' && maze[y+1][x] == '1' && maze[y+1][x+1] == '1')
	    cout << "A" << endl;
	  else if (maze[y+1][x] == '1' && maze[y+2][x] == '1' && maze[y+3][x] == '1')
	    cout << "B" << endl;
	  else if (maze[y][x+1] == '1' && maze[y][x+2] == '1' && maze[y][x+3] == '1')
	    cout << "C" << endl;
	  else if (maze[y+1][x] == '1' && maze[y+1][x-1] == '1' && maze[y+2][x-1] == '1')
	    cout << "D" << endl;
	  else if (maze[y][x+1] == '1' && maze[y+1][x+1] == '1' && maze[y+1][x+2] == '1')
	    cout << "E" << endl;
	  else if (maze[y+1][x] == '1' && maze[y+1][x+1] == '1' && maze[y+2][x+1] == '1')
	    cout << "F" << endl;
	  else
	    cout << "G" << endl;
	  used = true;
	}
        if(used)break;
      }
      if(used)break;
    }
  }

  return 0;
}

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

int main(){
	char ch[8][8];
	bool judged;
	
	while((scanf("%s", ch[0])) != EOF){
		for(int i = 1; i < 8; i++){
				scanf("%s", ch[i]);
		}
		
		judged = false;
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				if(ch[i][j] == '1'){
					//A
					if(i + 1 < 8 && ch[i + 1][j] == '1' &&
					 j + 1 < 8 && ch[i][j + 1] == '1' &&
					 ch[i + 1][j + 1] == '1'){
						printf("A\n");
						judged = true;
						break;
					}
					//B
					if(i + 3 < 8 && ch[i + 1][j] == '1' &&
					 ch[i + 2][j] == '1' && ch[i + 3][j] == '1'){
						printf("B\n");
						judged = true;
						break;
					}
					//C
					if(j + 3 < 8 && ch[i][j + 1] == '1' &&
					 ch[i][j + 2] == '1' && ch[i][j + 3] == '1'){
						printf("C\n");
						judged = true;
						break;
					}
					//D
					if(i + 2 < 8 && j - 1 >= 0 &&
					 ch[i + 1][j - 1] == '1' && ch[i][j + 1] == '1' &&
					 ch[i + 2][j - 1] == '1'){
						printf("D\n");
						judged = true;
						break;
					}
					//E
					if(i + 1 < 8 && j + 2 < 8 &&
					 ch[i][j + 1] == '1' && ch[i + 1][j + 1] == '1' &&
					 ch[i + 1][j + 2] == '1'){
						printf("E\n");
						judged = true;
						break;
					}
					//F
					if(i + 2 < 8 && j + 1 < 8 &&
					 ch[i + 1][j] == '1' && ch[i + 1][j + 1] == '1' &&
					 ch[i + 2][j + 1] == '1'){
						printf("F\n");
						judged = true;
						break;
					}
					//G
					if(i + 1 < 8 && j + 1 < 8 && j - 1 >= 0 &&
					 ch[i + 1][j] == '1' && ch[i][j + 1] == '1' &&
					 ch[i + 1][j - 1] == '1'){
						printf("G\n");
						judged = true;
						break;
					}
				}
			}
			
			if(judged) break;
		}
	}
	
	return 0;
}