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
}

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()
{
    while(true){
        int i=0;
        string map[8];
        while(cin>>map[i],!cin.eof()){
            i++;
            if(i==8){
                break;
            }
        }
        if(cin.eof()){
            break;
        }
        for(int i=0;i<8;i++){
            for(int j=0;j<8;j++){
                if(map[i][j]=='1' && map[i][j+1]=='1' && map[i+1][j]=='1' &&map[i+1][j+1]=='1'){
                    cout<<'A'<<endl;
                }
                else if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+2][j]=='1' &&map[i+3][j]=='1'){
                    cout<<'B'<<endl;
                }
                else if(map[i][j]=='1' && map[i][j+1]=='1' && map[i][j+2]=='1' &&map[i][j+3]=='1'){
                    cout<<'C'<<endl;
                }
                else if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+1][j-1]=='1' &&map[i+2][j-1]=='1'){
                    cout<<'D'<<endl;
                }
                else if(map[i][j]=='1' && map[i][j+1]=='1' && map[i+1][j+1]=='1' &&map[i+1][j+2]=='1'){
                    cout<<'E'<<endl;
                }
                else if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+1][j+1]=='1' &&map[i+2][i+1]=='1'){
                    cout<<'F'<<endl;
                }
                else if(map[i][j]=='1' && map[i][j-1]=='1' && map[i+1][j-1]=='1' &&map[i+1][j-2]=='1'){
                    cout<<'G'<<endl;
                }
            }
        }
    }
    return 0;
}

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

using namespace std;

int A[7][4][4]={
  
  {
    {1,1,0,0},
    {1,1,0,0},
    {0,0,0,0},
    {0,0,0,0},
  },
  
  {
    {1,0,0,0},
    {1,0,0,0},
    {1,0,0,0},
    {1,0,0,0},
  },
  
  {
    {1,1,1,1},
    {0,0,0,0},
    {0,0,0,0},
    {0,0,0,0},
  },
  
  {
    {0,1,0,0},
    {1,1,0,0},
    {1,0,0,0},
    {0,0,0,0},
  },
  
  {
    {1,1,0,0},
    {0,1,1,0},
    {0,0,0,0},
    {0,0,0,0},
  },
  
  {
    {1,0,0,0},
    {1,1,0,0},
    {0,1,0,0},
    {0,0,0,0},
  },
  
  {
    {0,1,1,0},
    {1,1,0,0},
    {0,0,0,0},
    {0,0,0,0},
  },
},
  
  a[12][12];

string s="ABCDEFG";

bool check(int x, int y, int n){
  
  for(int k=0;k<4;k++){
    for(int l=0;l<4;l++){
      int nx=x+k,ny=y+l;
      if(A[n][k][l]==1){
	if(a[nx][ny]!=A[n][k][l]){
	  return false;
	}
	if(nx<0||nx>7||ny<0||ny>7){
	  return false;
	}
      }
    }
  }
  return true;
}


int main(void){

  char ch;

  while(true){

    for(int i=0;i<12;i++)
      for(int j=0;j<12;j++)
	a[i][j]=0;
    
    for(int i=0;i<8;i++){
      for(int j=0;j<8;j++){
	if(scanf(" %c",&ch)==EOF)return 0;
	a[i][j]=ch-'0';
      }
    }
    bool fg=true;
    for(int k=0;fg && k<7;k++){
      for(int i=0;fg && i<8;i++){
	for(int j=0;fg && j<8;j++){
	  if(check(i,j,k)){
	    cout << s[k] << endl;
	    fg=false;
	  }
	}
      }
    }
  }

  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
 
int xb[7][3] = {
        {1, 0, 1},
        {0, 0, 0},
        {1, 2, 3},
        {0, -1, -1},
        {1, 1, 2},
        {0, 1, 1},
        {1, 0, -1}
};
 
int yb[7][3] = {
        {0, 1, 1},
        {1, 2, 3},
        {0, 0, 0},
        {1, 1, 2},
        {0, 1, 1},
        {1, 1, 2},
        {0, 1, 1}
};
 
int main() {
        string field[8];
        while(getline(cin, field[0])) {
                for(int i = 1; i < 8; i++) getline(cin, field[i]);
 
                char ans = '\0';
                rep(y,8) {
                        rep(x,8) {
                                if(field[y][x] == '1') {
                                        // cerr << "x: " << x << " " << "y: " << y << endl;
                                        rep(i,8) {
                                                bool f = true;
                                                rep(j,3) {
                                                        int nx = x + xb[i][j];
                                                        int ny = y + yb[i][j];
#if 1
                                                        if(0 <= nx && nx < 8 && 0 <= ny && ny < 8) {
                                                                if(field[ny][nx] != '1') {
                                                                        f = false;
                                                                        break;
                                                                }
                                                        }       
#endif
                                                }
                                                if(f) {
                                                        ans = 'A' + i;
                                                        goto END;
                                                }
                                        }
                                }
                        }
                }
        END:
                cout << ans << endl;
                getline(cin, field[0]);
        }
        return 0;
}