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<iostream>

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";

void check(){


  for(int n=0;n<7;n++){

    for(int i=0;i<8;i++){
      for(int j=0;j<8;j++){
	bool fg=true;
	for(int k=0;k<4;k++){
	  for(int l=0;l<4;l++){
	    if(a[i+k][j+l]!=A[n][k][l]){
	      fg=false;
	      break;
	    }
	    if(i+k<0||i+k>7||j+l<0||j+k>7){
	      fg=false;
	      break;
	    }
	  }
	}
	if(fg){
	  cout << s[n] << endl;
	  return;
	}
	fg=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++){
	cin.get(ch);
	if(cin.eof())return 0;
	a[i][j]=ch-'0';
      }
      cin.ignore();
    }
    check();
  }

  return 0;
}

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

#define SIZE 8

int main() {
	string source[SIZE];
	while (!cin.eof()) {
		for (int i = 0; i < SIZE; i++) {
			cin >> source[i];
		}

		int map[14][14], x = SIZE, y = SIZE;
		for (int i = 0; i < SIZE; i++) {
			for (int j = 0; j < SIZE; j++) {
				map[i + 3][j + 3] = source[i][j] == '1' ? 1 : 0;
				if (source[i][j] == '1' && j < x && i < y) {
					x = j;
					y = i;
				}
			}
		}
		x += 3;
		y += 3;

		if (map[y + 1][x + 1] == 1) {
			if (map[y][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "A";
			} else if (map[y + 2][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "F";
			} else if (map[y + 1][x + 2] == 1 && map[y][x + 1] == 1) {
				cout << "E";
			}
		} else if (map[y - 1][x - 1] == 1) {
			if (map[y][x + 1] == 1 && map[y + 1][x] == 1) {
				cout << "G";
			} else if (map[y + 2][x - 1] == 1 && map[y + 1][x] == 1) {
				cout << "D";
			}
		} else if (map[y + 1][x] == 1 && map[y + 2][x] == 1 && map[y + 3][x] == 1) {
			cout << "B";
		} else if (map[y][x + 1] == 1 && map[y][x + 2] == 1 && map[y][x + 3] == 1) {
			cout << "C";
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

const char figure[][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' }
				}
			};

bool match_pattern (int k, int row, int col, vector <string> plane)
{
	int i,j;

	for (i = 0; i < 4; ++i){
		for (j = 0; j < 4; ++j){
			if (plane[row+i][col+j] == figure[k][i][j]){
				continue;
			}else{
				return false;
			} // end if
		} // end for
	} // end for
	
	return true;
}
	
int main()
{
//	cut here before submit 
//	freopen("testcase.fs", "r", stdin);
	string str = "";
	int count = 0;
	int row  = 0;
	int i,j,k;

	vector <string> plane (11, string(11, '0') );
	
	while (getline (cin, str ) ){
		if (str.empty() && count < 2){
			++count;
			row = 0;
			continue;
		}else{
			count = 0;
		} // end if

		if (count > 1){
			break;
		} // end if

		for (j = 0; j < str.length(); ++j){
			plane[row][j] = str[j];
		} // end for
		++row;
		int res = -1;
		if (row == 8){
			for (i = 0; i < 8; ++i){
				for (j = 0; j < 8; ++j){
					if (plane[i][j] == '0'){
						if (match_pattern (3, i, j, plane) ){
							res = 3;
							goto result;
						} // end if
						if ( match_pattern (6, i, j, plane) ){
							res = 6;
							goto result;
						} // end if			
					}else{	// if (plane[i][j] == '1')
						for (k = 0; k < 7; ++k){
							if (k != 3 && k != 6 && match_pattern (k, i, j, plane) ){
								res = k;
								goto result;
							} // end if
						} // end for
					} // end if
				} // end for
			} // end for
		} // end if
result:
		if (res != -1){
			char c = 'A'+res;
			cout << c << endl;
		} // end if			

	} // end while
		
	return 0;
}