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 <cstdio>
using namespace std;

char map[8][9];

int main(void)
{
    int x, y;
    
    while (scanf("%s", map[0]) != EOF){
        if (!(map[0][0] == '0' || map[0][0] == '1')){
            continue;
        }
        
        for (int i = 1; i < 8; i++){
            scanf("%s", map[i]);
        }
        
        for (int i = 0; i < 64; i++){
			if(map[i / 8][i % 8] == '1'){
				x = i % 8;
				y = i / 8;
				break;
			}
		}
		if((map[y + 1][x] == '1') && (map[y][x + 1] == '1') && (map[y + 1][x + 1] == '1'))
        {
			printf("A\n");
		}
        else if((map[y + 1][x] == '1') && (map[y + 2][x] == '1') && (map[y + 3][x] == '1'))
        {
			printf("B\n");
		}
        else if((map[y][x + 1] == '1') && (map[y][x + 2] == '1') && (map[y][x + 3] == '1'))
        {
			printf("C\n");
		}
        else if((map[y][x + 1] == '1') && (map[y + 1][x + 1] == '1') && (map[y + 1][x + 2] == '1'))
        {
			printf("E\n");
		}
        else if((map[y + 1][x] == '1') && (map[y + 1][x + 1] == '1') && (map[y + 2][x + 1] == '1'))
        {
			printf("F\n");
		}
        else if((map[y][x + 1] == '1') && (map[y + 1][x] == '1') && (map[y + 1][x - 1] == '1'))
        {
			printf("G\n");
		}
        else if((map[y + 2][x - 1] == '1') && (map[y + 1][x] == '1') && (map[y + 1][x - 1] == '1'))
        {
			printf("D\n");
		}
        
    }
    
    return (0);
}

C++: #include<stdio.h>

int main(){

char ch[9][9]={};
int x=0,y=0;
bool f=true;
//while(1){
	bool F=true;
for(int i=0;i<8;i++)
for(int j=0;j<9;j++)
{char cc;
	//if(j==8)scanf("%c",&cc);
scanf("%c",&ch[i][j]);
if(ch[i][j]=='1'&&F==true){x=j;y=i;F=false;}
if(ch[i][j]==EOF)f=false;}


	

if(ch[y][x+1]=='1'&&ch[y+1][x]=='1'&&ch[y+1][x+1]=='1')printf("A\n");

if(ch[y+1][x]=='1'&&ch[y+2][x]=='1'&&ch[y+3][x]=='1')printf("B\n");

if(ch[y][x+1]=='1'&&ch[y][x+2]=='1'&&ch[y][x+3]=='1')printf("C\n");

if(ch[y+2][x-1]=='1'&&ch[y+1][x]=='1')printf("D\n");

if(ch[y][x+1]=='1'&&ch[y+1][x+2]=='1')printf("E\n");

if(ch[y+1][x]=='1'&&ch[y+2][x+1]=='1')printf("F\n");

if(ch[y][x+1]=='1'&&ch[y+1][x-1]=='1')printf("G\n");
/*
if(f==false)break;
}*/
return 0;
}

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

int main(){
	char n[12][12];
	char figure[7][4][4] = {
		{"1100","1100","0000","0000"},
		{"1000","1000","1000","1000"},
		{"1111","0000","0000","0000"},
		{"0100","1100","1000","0000"},
		{"1100","0110","0000","0000"},
		{"1000","1100","0100","0000"},
		{"0110","1100","0000","0000"}
	};

	for(int i=0; i<12; i++)
		for(int j=0; j<12; j++)
			n[i][j]='0';
	
	while(~scanf("%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n\n", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7])){

		for(int i=0; i<7; i++){
			for(int j=0; j<8; j++){
				for(int k=0; k<8; k++){
					bool flag=true;
					
					for(int x=0; x<4; x++){
						for(int y=0; y<4; y++){
							if(figure[i][x][y] != n[j+x][k+y]) flag = false;
						}
					}
					
					if(flag){
						cout << (char)('A'+i) << endl;
					}

				}
			}
		}
	}
	return 0;
}

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

using namespace std;

int main() {

    string s = "";
    string graph[7] =
    {
        "1100110000000000",
        "1000100010001000",
        "1111000000000000",
        "0100110010000000",
        "1100011000000000",
        "1000110001000000",
        "0110110000000000"
    };

    int find = 0;
    char field[8][9];

    for(int i = 0; i < 8; ++i) {
        cin >> field[i];
    }

    for(int i = 0; i < 8 && find == 0; ++i) {
        for(int j = 0; j < 6 && find == 0; ++j) {
            if(field[i][j] == '1' || field[i][j + 1] == '1' && field[i - 1][j] == '1') {
                find = 1;
                for(int k = i; k < i + 4; ++k) {
                    for(int l = j; l < j + 4; ++l) {
                        s += field[k][l];
                    }
                }
            }
        }
    }

    for(int i = 0; i < 7; ++i) {
        if(s == graph[i]) {
            cout << (char)('A' + i) << endl;
            break;
        }
    }

}

C++: #include <iostream>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <string>
#include <map>
#include <vector>
#include <stack>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)

char mass[8][8];

char solve(int i, int j)
{
    if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i+1][j] == '1' && mass[i+1][j+1] == '1') {
        return 'A';
    }
    else if (mass[i][j] == '1' && mass[i+1][j] == '1' && mass[i+2][j] == '1' && mass[i+3][j] == '1') {
        return 'B';
    }
    else if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i][j+2] == '1' && mass[i][j+3] == '1') {
        return 'C';
    }
    else if (mass[i][j] == '1' && mass[i+1][j] == '1' && mass[i+1][j-1] == '1' && mass[i+2][j-1] == '1') {
        return 'D';
    }
    else if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i+1][j+1] == '1' && mass[i+1][j+2] == '1') {
        return 'E';
    }
    else if (mass[i][j] == '1' && mass[i+1][j] == '1' && mass[i+1][j+1] == '1' && mass[i+2][j+1] == '1') {
        return 'F';
    }
    else if (mass[i][j] == '1' && mass[i][j+1] == '1' && mass[i+1][j] == '1' && mass[i+1][j-1] == '1') {
        return 'G';
    }
    
    return 0;
}

int main(void)
{
    char c;
    bool f;
    
    while (!cin.eof()) {
        f = false;

        rep(i, 8) {
            cin >> mass[i];
        }
        
        rep(i, 8) {
            rep(j, 8) {
                if (mass[i][j] == '1' && f == false) {
                    c = solve(i, j);
                    cout << c << endl;
                    f = true;
                }
            }
        }
    }
    
    return 0;
}