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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; 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 < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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>
#include <vector>

using namespace std;

bool one(const vector<string> &v, int x, int y) {
    if(x < 0 || y < 0 || x >= v[0].size() || y >= v.size()) return false;
    return v[y][x] == '1';
}

int main() {
    vector<string> v(8);
    while(cin >> v[0]) {
        for(int i = 1; i < 8; ++i) cin >> v[i];

        char kind;
        for(int y = 0; y < 8; ++y) {
            for(int x = 0; x < 8; ++x) {
                if(one(v, x, y)) {
                    if(one(v, x+1, y) && one(v, x, y+1) && one(v, x+1, y+1)) kind = 'A';
                    else if(one(v, x, y+1) && one(v, x, y+2) && one(v, x, y+3)) kind = 'B';
                    else if(one(v, x+1, y) && one(v, x+2, y) && one(v, x+3, y)) kind = 'C';
                    else if(one(v, x, y+1) && one(v, x-1, y+1) && one(v, x-1, y+2)) kind = 'D';
                    else if(one(v, x+1, y) && one(v, x+1, y+1) && one(v, x+2, y+1)) kind = 'E';
                    else if(one(v, x, y+1) && one(v, x+1, y+1) && one(v, x+2, y+2)) kind = 'F';
                    else if(one(v, x+1, y) && one(v, x, y+1) && one(v, x-1, y+1)) kind = 'G';
                    goto end;
                }
            }
        }
end:
        cout << kind << endl;
    }
    return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

char mp[8][9];

int A[4][2] = {{0, 0}, {0, 1}, {1, 0}, {1, 1}};
int B[4][2] = {{0, 0}, {1, 0}, {2, 0}, {3, 0}};
int C[4][2] = {{0, 0}, {0, 1}, {0, 2}, {0, 3}};
int D[4][2] = {{0, 1}, {1, 0}, {1, 1}, {2, 0}};
int E[4][2] = {{0, 0}, {0, 1}, {1, 1}, {1, 2}};
int F[4][2] = {{0, 0}, {1, 0}, {1, 1}, {2, 1}};
int G[4][2] = {{1, 0}, {1, 1}, {0, 1}, {0, 2}};

int main()
{
    int nyan = 0;
    while (1) {
        int i = 0;
        while (1) {
            int res = scanf("%s", mp[i++]);
            if (res == EOF) return 0;
            if (i == 8) break;
        }

        int cnt;

        for (int i = 0; i < 8; ++i) for (int j = 0; j < 8; ++j) {
            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + A[k][0], nx = j + A[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("A");
                continue;
            }

            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + B[k][0], nx = j + B[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("B");
                continue;
            }

            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + C[k][0], nx = j + C[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("C");
                continue;
            }

            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + D[k][0], nx = j + D[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("D");
                continue;
            }

            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + E[k][0], nx = j + E[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("E");
                continue;
            }

            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + F[k][0], nx = j + F[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("F");
                continue;
            }

            cnt = 0;
            for (int k = 0; k < 4; ++k) {
                int ny = i + G[k][0], nx = j + G[k][1];
                if (ny < 0 || ny >= 8 || nx < 0 || nx >= 8 || mp[ny][nx] == '0') break;
                cnt++;
            }
            if (cnt == 4) {
                puts("G");
                continue;
            }
        }
    }
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to) 

int main() {
	int t[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}}};
	string str;
	while(cin >> str) {
		vector<string> s(8);
		s[0] = str;
		int board[11][11];
		rep2(i,1,8) {
			cin >> s[i];
		}
		rep(i,11) {
			rep(j,11) {
				board[i][j] = 0;
			}
		}
		
		rep(i,8) {
			rep(j,8) {
				board[i][j] = s[i][j] - '0';
			}
		}
		rep(i,64) {
			bool f = 1;
			rep(k,7) {
				f = 1;
				rep(l,16) {
					if(board[i / 8 + l / 4][i % 8 + l % 4] != t[k][l / 4][l % 4]) {
						f = 0;
						break;
					}
				}
				if(f) {
					cout << (char) (k + 'A') << endl;
					break;
				}
			}
			if(f) break;
		}
	}
	return 0;
}