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

int main(){
	char area[8][8];
	char c;
	while(cin >> c){
		while(!isalnum(c)) cin >> c;
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				area[i][j] = c;
				if(i ==  7 && j == 7) break;
				cin >> c;
			}
		}
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				if(area[i][j] == '1'){
					if(i+1 < 8 && area[i+1][j] == '1'){
						if(i+2 < 8 && area[i+2][j] == '1'){
							if(i+3 < 8 && area[i+3][j] == '1'){
								cout << "B";
							}
						}
						if(j+1 < 8 && area[i+1][j+1] == '1'){
							if(i+2 < 8 && area[i+2][j+1] == '1'){
								cout << "F";
							}
							if(area[i][j+1] == '1'){
								cout << "A";
							}
							if(j-1 >= 0 && area[i+1][j-1] == '1'){
								cout << "G";
							}
						}
						if(j+1 < 8 && area[i][j+1] == '1'){
							if(i-1 >= 0 && area[i-1][j+1] == '1'){
								cout << "D";
							}
						}
					}else if(j+1 < 8 && area[i][j+1] == '1'){
						if(j+2 < 8 && area[i][j+2] == '1'){
							if(j+3 < 8 && area[i][j+3] == '1'){
								cout <<"C";
							}
						}
						if(i+1 < 8 && area[i+1][j+1] == '1'){
							if(j+2 < 8 && area[i+1][j+2] == '1'){
								cout << "E";
							}
						}
					}
				}
			}
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

char field[11][11],field2[11][11];

int main(void){
	while(1){
		int i,j;
		bool flag=false;
		for(j=0;j<11;j++){
			for(i=0;i<11;i++){
				field[i][j]='\0';
				field2[i][j]='\0';
			}
		}
		for(i=0;i<8;i++){
			if(scanf("%s",field[i])==EOF){
				flag=true;
				break;
			}
		}
		if(flag)break;
		for(j=0;j<8;j++){
			for(i=0;i<8;i++){
				field2[i][j]=field[j][i];
			}
		}
		for(j=0;j<8;j++){
			for(i=0;i<8;i++){
				if(field2[i][j]=='1' && field2[i+1][j]=='1' && field2[i][j+1]=='1' && field2[i+1][j+1]=='1')printf("A\n");
				if(field2[i][j]=='1' && field2[i][j+1]=='1' && field2[i][j+2]=='1' && field2[i][j+3]=='1')printf("B\n");
				if(field2[i][j]=='1' && field2[i+1][j]=='1' && field2[i+2][j]=='1' && field2[i+3][j]=='1')printf("C\n");
				if(field2[i+1][j]=='1' && field2[i+1][j+1]=='1' && field2[i][j+1]=='1' && field2[i][j+2]=='1')printf("D\n");
				if(field2[i][j]=='1' && field2[i+1][j]=='1' && field2[i+1][j+1]=='1' && field2[i+2][j+1]=='1')printf("E\n");
				if(field2[i][j]=='1' && field2[i][j+1]=='1' && field2[i+1][j+1]=='1' && field2[i+1][j+2]=='1')printf("F\n");
				if(field2[i][j+1]=='1' && field2[i+1][j+1]=='1' && field2[i+1][j]=='1' && field2[i+2][j]=='1')printf("G\n");
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <string>

using namespace std;

int main()
{
	char ret;
	string s;
	
	for(int i=0;i<8;i++){
		string s_tmp;
		cin>>s_tmp;
		s += s_tmp;
	}
	// 2次元配列を1次元的に処理
	for(int i=0;i<8*8;i++){
		if(s[i]=='1'){
			// Aかどうか
			if(s[i+1]=='1' && s[i+8]=='1' && s[i+9]=='1'){
				ret = 'A';
				break;
			}else if(s[i+8]=='1' && s[i+16]=='1' && s[i+24]=='1'){
				ret = 'B';
				break;
			}else if(s[i+1]=='1' && s[i+2]=='1' && s[i+3]=='1'){
				ret = 'C';
				break;
			}else if(s[i+7]=='1' && s[i+8]=='1' && s[i+15]=='1'){
				ret = 'D';
				break;
			}else if(s[i+1]=='1' && s[i+9]=='1' && s[i+10]=='1'){
				ret = 'E';
				break;
			}else if(s[i+8]=='1' && s[i+9]=='1' && s[i+17]=='1'){
				ret = 'F';
				break;
			}else if(s[i+1]=='1' && s[i+7]=='1' && s[i+8]=='1'){
				ret = 'G';
				break;
			}
		}
	}
	cout<<ret<<endl;
	return 0;
}

C++: #include <bits/stdc++.h>
using namespace std;

int main()
{
  char field[8][8];

  for (int i = 0; i < 8; i++){
    for (int j = 0; j < 8; j++){
      cin >> field[i][j];
    }
  }
  
  bool judge = false;
  for (int i = 0; i < 8; i++){
    for (int j = 0; j < 8; j++){
      if (field[i][j] == '1'){
        if (field[i + 3][j] == '1'){
          cout << 'B';
        }
        else if (field[i][j + 3] == '1'){
          cout << 'C';
        }
        else if (field[i + 2][j - 1] == '1'){
          cout << 'D';
        }
        else if (field[i + 1][j + 2] == '1'){
          cout << 'E';
        }
        else if (field[i + 2][j + 1] == '1'){
          cout << 'F';
        }
        else if (field[i + 1][j - 1] == '1'){
          cout << 'G';
        }
        else {
          cout << 'A';
        }
        judge = true;
      }
      if (judge)  break;
    }
    if (judge)  break;
  }
  cout << endl;
}

C++: #include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <iterator>
#include <stack>
typedef long long int lli;
using namespace std;

int dx[7][4]={{0,0,1,1},{0,0,0,0},{0,1,2,3},{0,0,-1,-1},{0,1,1,2},{0,0,1,1},{0,-1,0,1}};
int dy[7][4]={{0,1,1,0},{0,1,2,3},{0,0,0,0},{0,1,1,2},{0,0,1,1},{0,1,1,2},{0,1,1,0}};
string MAP[8];
string ans="ABCDEFG";

int main(){
	while(1){
	for(int i=0; i<8; ++i){
		cin >> MAP[i];
		if(!cin.eof()){
			return 0;
		}
	}
	for(int i=0; i<8; ++i){
		for(int j=0; j<8; ++j){
			if(MAP[i][j]=='1'){
				for(int k=0; k<7; ++k){
					bool ok=true;
					for(int l=0; l<4; ++l){
						int nx=j+dx[k][l];
						int ny=i+dy[k][l];
						if((0<=nx&&nx<8&&0<=ny&&ny<8&&MAP[ny][nx]!='1')||(nx<0||8<=nx||ny<0||8<=ny)){
							ok=false;
							break;
						}
					}
					if(ok){
						cout << ans[k] << "\n";
						break;
					}
				}
			}
		}
	}
	}
	return 0;
}