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

C++: #include <iostream>
#include <vector>
using namespace std;
int cx[7][3]={{1,0,1}, {0,0,0}, {1,2,3}, {-1,0,-1}, {1,1,2}, {0,1,1}, {1,-1,0}};
int cy[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(){
	char field[8][8];
	while(cin >> field[0][0]){
		for(int i=0; i<8; i++){
			for(int j=0; j<8; j++){
				if(i==0 && j==0) continue;
				cin >> field[i][j];
			}
		}
		int sx=-1, sy=-1;
		vector<int> x,y;
		for(int i=0; i<8; i++){
			for(int j=0; j<8; j++){
				if(field[i][j]=='1'){
					if(sx==-1){
						sx = j;
						sy = i;
					}else{
						x.push_back(j-sx);
						y.push_back(i-sy);
					}
				}
			}
		}
		
		for(int i=0; i<7; i++){
			bool flag = true;
			for(int j=0; j<3; j++){
				if(cx[i][j]!=x[j] || cy[i][j]!=y[j]){
					flag = false;
					break;
				}
			}
			if(flag){
				cout << (char)('A'+i) << endl;
				break;
			}
		}
	}
    return 0;
}

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

int ax[]={1, 0, 1};
int ay[]={0, 1, 1};

int bx[]={0, 0, 0};
int by[]={1, 2, 3};

int cx[]={1, 2, 3};
int cy[]={0, 0, 0};

int dx[]={-1, 0, -1};
int dy[]={1, 1, 2};

int ex[]={1, 1, 2};
int ey[]={0, 1, 1};

int fx[]={0, 1, 1};
int fy[]={1, 1, 2};

int gx[]={1, -1, 0};
int gy[]={0, 1, 1};


int main(){
	char map[12][12];
	int x, y;

	for(int i=0;i<12;i++){
		for(int j=0;j<12;j++){
			map[i][j]=0;
		}
	}

	while(1){
		for(int i=0; i<8; i++)
			cin>>map[i];

		if(cin.eof())break;

		x=y=0;
		for(int i=0; i<64; i++){
			if(map[i/8][i%8]=='1'){
				x=i%8;
				y=i/8;
				break;
			}
		}

		if(map[y+ay[0]][x+ax[0]]=='1'&&map[y+ay[1]][x+ax[1]]=='1'&&map[y+ay[2]][x+ax[2]]=='1')
			cout<<"A\n";
		else if(map[y+by[0]][x+bx[0]]=='1'&&map[y+by[1]][x+bx[1]]=='1'&&map[y+by[2]][x+bx[2]]=='1')
			cout<<"B\n";
		else if(map[y+cy[0]][x+cx[0]]=='1'&&map[y+cy[1]][x+cx[1]]=='1'&&map[y+cy[2]][x+cx[2]]=='1')
			cout<<"C\n";
		else if(map[y+dy[0]][x+dx[0]]=='1'&&map[y+dy[1]][x+dx[1]]=='1'&&map[y+dy[2]][x+dx[2]]=='1')
			cout<<"D\n";
		else if(map[y+ey[0]][x+ex[0]]=='1'&&map[y+ey[1]][x+ex[1]]=='1'&&map[y+ey[2]][x+ex[2]]=='1')
			cout<<"E\n";
		else if(map[y+fy[0]][x+fx[0]]=='1'&&map[y+fy[1]][x+fx[1]]=='1'&&map[y+fy[2]][x+fx[2]]=='1')
			cout<<"F\n";
		else if(map[y+gy[0]][x+gx[0]]=='1'&&map[y+gy[1]][x+gx[1]]=='1'&&map[y+gy[2]][x+gx[2]]=='1')
			cout<<"G\n";

	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <stdio.h>
using namespace std;
int main() {
  char c[11][11];
  vector<int> v;
  int dat[7][6]={{1,1,1,1,0,0},{1,0,1,0,1,0},{1,1,0,0,0,0},{1,0,1,0,0,0},{1,1,0,1,0,0},
  {1,0,1,1,0,1},{1,1,1,0,0,0}};
  int i,j,k,x,y,f,g=0;
  while(g==0) {
      f=0;
	  for (i=0;i<8;i++) {
		  gets(c[i]);
		  if (f==0) for (j=0;j<8;j++) if (c[i][j]=='1') { f=1; x=j; y=i; j=9;}
	  }
	  if (gets(c[8])==NULL) g=1; 
	  for (k=0;k<7;k++) {
		  f=0;
		  for (i=0;i<3;i++) for (j=0;j<2;j++) {
			  if (x+j>7 || y+i>7) { if (dat[k][j+i*2]==0) f++;}  else
				  if (c[y+i][x+j]==('0'+dat[k][j+i*2])) f++;
		  }
		  if (f==6) break;
	  }
	  v.push_back(k);
	  }
  for (i=0;i<v.size();i++) cout << (char)('A'+v[i]) << endl;
  return 0;
}