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(), "")
		if reflect.DeepEqual(row, []string{}) {
			break
		}
		for j := 0; j < 8; j++ {
			ret[i][j], _ = strconv.Atoi(row[j])
		}
	}
	return ret
}

var emptyBoard = [][]int{{0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0}}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, emptyBoard) {
			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 <cstdio>
using namespace std;

char map[8][8];
 
void check(void)
{
  for (int i = 0; i < 8; i++){
    for (int j = 0; j < 8; j++){
      if (map[i][j] == '1'){
        if (map[i][j + 1] == '1' && map[i + 1][j] == '1' && map[i + 1][j + 1] == '1'){
          puts("A");
        }
        else if (map[i + 1][j] == '1' && map[i + 2][j] == '1' && map[i + 3][j] == '1'){
          puts("B");
        }
        else if (map[i][j + 1] == '1' && map[i][j + 2] == '1' && map[i][j + 3] == '1'){
          puts("C");
        }
        else if (map[i + 1][j] == '1' && map[i + 1][j - 1] == '1' && map[i + 2][j - 1] == '1'){
          puts("D");
        }
        else if (map[i][j + 1] == '1' && map[i + 1][j + 1] == '1' && map[i + 1][j + 2] == '1'){
          puts("E");
        }
        else if (map[i + 1][j] == '1' && map[i + 1][j + 1] == '1' && map[i + 2][j + 1] == '1'){
          puts("F");
        }
        else if (map[i][j + 1] == '1' && map[i + 1][j] == '1' && map[i + 1][j - 1] == '1'){
          puts("G");
        }
      }
    }
  }
} 
int main()
{
    while (scanf(" %c", &map[0][0]) != EOF){
      for (int i = 1; i < 8; i++){
        scanf(" %c", &map[0][i]);
      }   
      for (int i = 1; i < 8; i++){
        for (int j = 0; j < 8; j++){
          scanf(" %c", &map[i][j]);
        }
      }     
      check();
    }
    return (0);
}

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

int main(void){
	string s[8];
	while(cin>>s[0]){
		std::vector<pair<int,int> > v;
		for(int i=1;i<8;i++)cin>>s[i];
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(s[i][j]=='1')v.push_back(make_pair(i,j));
			}
		}
		// second=x,first=y
		if(v[0].first==v[1].first&&v[0].second==v[2].second)cout<<"A"<<endl;
		else if(v[0].second==v[1].second&&v[2].second==v[1].second&&v[2].second==v[3].second)cout<<"B"<<endl;
		else if(v[2].first==v[0].first)cout<<"C"<<endl;
		else if(make_pair(v[0].first+2,v[0].second-1)==v[3])cout<<"D"<<endl;
		else if(make_pair(v[0].first+1,v[0].second+2)==v[3])cout<<"E"<<endl;
		else if(make_pair(v[9].first+2,v[0].second+1)==v[3])cout<<"F"<<endl;
		else cout<<"G"<<endl;
		// cin>>s[0]; // CRLF
	}
}

C++: 
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<math.h>
#include<string>
#include<string.h>
#include<stack>
#include<queue>
#include<vector>
#include<utility>
#include<set>
#include<map>
#include<stdlib.h>
#include<iomanip>

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;

int main(void) {
  int i,j,k;
  int n=8;
  vector<string> s;
  string t;
  while(cin>>t)s.push_back(t);

  rep(i,s.size()){
    for(j=i;j<i+n;j++)rep(k,n)if(s[j][k]=='1'){
	if(j+1<i+n && k+1<n && s[j][k+1]=='1' && s[j+1][k]=='1' && s[j+1][k+1]=='1')
	  cout<<"A"<<endl;
	if(j+3<i+n && s[j+1][k]=='1' && s[j+2][k]=='1' && s[j+3][k]=='1')
	  cout<<"B"<<endl;
	if(k+3<n && s[j][k+1]=='1' && s[j][k+2]=='1' && s[j][k+3]=='1')
	  cout<<"C"<<endl;
	if(j+2<i+n && k!=0 && s[j+1][k]=='1' && s[j+1][k-1]=='1' && s[j+2][k-1]=='1')
	  cout<<"D"<<endl;
	if(j+1<i+n && k+2<n && s[j][k+1]=='1' && s[j+1][k+1]=='1' && s[j+1][k+2]=='1')
	  cout<<"E"<<endl;
	if(j+2<i+n && k+1<n && s[j+1][k]=='1' && s[j+1][k+1]=='1' && s[j+2][k+1]=='1')
	  cout<<"F"<<endl;
	if(j+1<n+i && k && k+1<n && s[j][k+1]=='1' && s[j+1][k]=='1' && s[j+1][k-1]=='1')
	  cout<<"G"<<endl;
	goto END;
      }
  END:i+=n-1;
  }
}

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

int main(void) {
	int i;
	char field[65];
	char image[8][26] = {
		"1100000011",
		"1000000010000000100000001",
		"1111",
		"1000000110000001",
		"11000000011",
		"100000001100000001",
		"110000011"
	};

	while (cin >> field) {
		//cout<<field;
		for (i = 1; i < 8; i++) {
			cin >> image[7];
			strcat(field, image[7]);
			//cout<<field;
		}
		//cout<<endl;
		field[64] = '\0';
		for (i = 0; i < 7; i++) {
			char *pFind = strstr(field, image[i]);
			//cout<<pFind<<endl;
			if (pFind != NULL) {
				cout << char('A' + i) << endl;
				break;
			}
		}
	}

	return 0;
}

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

void solve(vector<vector<char> > a){
	for(int i = 0; i < 6; i++){
		for(int j = 0; j < 6; j++){
			if(a[i][j] == '1' && a[i + 1][j] == '1' && a[i][j + 1] == '1' && a[i + 1][j + 1] == '1'){
				cout << "A" << endl;
				return;
			}else if(a[i][j] == '1' && a[i + 1][j] == '1' && a[i + 2][j] == '1'){
				cout << "B" << endl;
				return;
			}else if(j > 0 && i > 0){
				if(a[i][j] == '1' && a[i - 1][j - 1] == '1' && a[i + 1][j] == '1' && a[i + 2][j + 1] == '1'){
					cout << "D" << endl;
					return;
				}else if(a[i][j] == '1' && a[i][j - 1] == '1' && a[i + 1][j] == '1' && a[i + 1][j + 1] == '1'){
					cout << "E" << endl;
					return;
				}else if(a[i][j] == '1' && a[i + 1][j] == '1' && a[i + 1][j + 1] == '1' && a[i + 2][j + 1] == '1'){
					cout << "F" << endl;
					return;
				}else if(a[i][j] == '1' && a[i][j + 1] == '1' && a[i + 1][j - 1] == '1' && a[i + 1][j] == '1'){
					cout << "G" << endl;
					return;
				}
			}
		}
	}
	cout << "C" << endl;
}

int main(){
	vector<vector<char> > a(8, vector<char>(8));
	for(int i = 0; i < 8; i++){
		for(int j = 0; j < 8; j++){
			cin >> a[i][j];
		}
	}
	solve(a);
}