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 = k;
							goto result;
						} // end if
						if ( match_pattern (6, i, j, plane) ){
							res = k;
							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<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(i<7 && j<7){
                    if(map[i][j]=='1' && map[i][j+1]=='1' && map[i+1][j]=='1' && map[i+1][j+1]=='1'){
                        cout<<'A'<<endl;
                    }
                }
                if(i<5){
                    if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+2][j]=='1' && map[i+3][j]=='1'){
                        cout<<'B'<<endl;
                    }
                }
                if(j<5){
                    if(map[i][j]=='1' && map[i][j+1]=='1' && map[i][j+2]=='1' && map[i][j+3]=='1'){
                        cout<<'C'<<endl;
                    }
                }
                if(j>0 && i<6){
                    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;
                    }
                }
                if(i<7 && j<6){
                    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;
                    }
                }
                if(i<6 && j<7){
                    if(map[i][j]=='1' && map[i+1][j]=='1' && map[i+1][j+1]=='1' && map[i+2][j+1]=='1'){
                        cout<<'F'<<endl;
                    }
                }
                if(i<7 && j>1){
                    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;
                    }
                }
                else{
                    cout<<"other"<<endl;
                }
            }
        }
    }
    return 0;
}