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
}

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

int main() {
	int a = 0;
	char maze[10][10];
	for (int i = 0; i < 10; i++) {
		for (int j = 0; j < 10; j++) {
			maze[i][j] = '0';
		}
	}
	while (cin >> maze[1][1]) {
		for (int i = 2; i < 9; i++) {
			cin >> maze[1][i];
		}
		for (int i = 2; i < 9; i++) {
			for (int j = 1; j < 9; j++) {
				cin >> maze[i][j];
			}
		}
		int ok = 0;
		for (int i = 1; i < 9; i++) {
			for (int j = 1; j < 9; j++) {
				if (maze[i][j] == '1') {
					ok = 1;
					if (maze[i][j + 1] == '1') {
						if (maze[i][j + 2] == '1') {
							cout << "C" << endl;
						}
						else {
							if (maze[i + 1][j] == '1') {
								if (maze[i + 1][j + 1] == '1') {
									cout << "A" << endl;
								}
								else {
									cout << "G" << endl;
								}
							}
							else {
								cout << "E" << endl;
							}
						}
					}
					else {
						if (maze[i + 1][j - 1] == '1') {
							cout << "D" << endl;
						}
						else if (maze[i + 1][j + 1] == '1') {
							cout << "F" << endl;
						}
						else {
							cout << "B" << endl;
						}
					}
				}
				if (ok) break;
			}
			if (ok) break;
		}
		//if (a) cout << endl;
		a++;
	}

}

C++: #include <bits/stdc++.h>
using namespace std;

typedef complex<int> P;

namespace std{
	bool operator < (const P &a,const P &b){
		if( a.real() != b.real() ) return a.real() < b.real();
		return a.imag() < b.imag();
	}
	bool operator == (const P &a,const P &b){
		if( a.real() != b.real() ) return false;
		return a.imag() == b.imag();
	}
};

vector<vector<P>> ptn = {
	{P(0,0),P(1,1),P(1,0),P(0,1)},
	{P(0,0),P(0,2),P(0,1),p(0,3)},
	{P(0,0),P(1,0),P(2,0),P(3,0)},
	{P(1,0),P(1,1),P(0,1),P(0,2)},
	{P(0,0),P(1,0),P(1,1),P(2,1)},
	{P(0,0),P(0,1),P(1,1),P(1,2)},
	{P(1,0),P(2,0),P(0,1),P(1,1)}
};

string s[8];
int main(){
	while(true){
		for(int i = 0 ; i < 8 ; i++){
			if(!(cin >> s[i]))exit(0);
			
		}
		for(int i = 0 ; i < 7 ; i++)
			sort(ptn[i].begin(),ptn[i].end());
		for(int i = -10 ; i <= 10 ; i++)
			for(int j = -10 ; j <= 10 ; j++){
				vector<P> tmp;
				for(int y = 0 ; y < 8 ; y++)
					for(int x = 0 ; x < 8 ; x++){
						if( s[y][x] == '1'){
							tmp.push_back(P(x-j,y-i));
						}
					}
				sort(tmp.begin(),tmp.end());
				for(int k = 0 ; k < 7 ; k++){
					if( tmp == ptn[k] ){
						cout << (char)(k+'A') << endl;
					}
				}
			}
	}
					
					
	
	
}

C++: #include <iostream>
#include <string>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <algorithm>

using namespace std;

char Types(char x[12][11]);

int main () {
    char x[100];
    for(int i=0; i<100; i++){
        x[i]='0';
    }


    while(cin>>x[0]>>x[1]>>x[2]>>x[3]>>x[4]>>x[5]>>x[6]>>x[7]>>x[8]>>x[9]>>x[10]>>x[11]>>x[12]>>x[13]>>x[14]>>x[15]>>x[16]>>x[17]>>x[18]>>x[19]>>x[20]>>x[21]>>x[22]>>x[23]>>x[24]>>x[25]>>x[26]>>x[27]>>x[28]>>x[29]>>x[30]>>x[31]>>x[32]>>x[33]>>x[34]>>x[35]>>x[36]>>x[37]>>x[38]>>x[39]>>x[40]>>x[41]>>x[42]>>x[43]>>x[44]>>x[45]>>x[46]>>x[47]>>x[48]>>x[49]>>x[50]>>x[51]>>x[52]>>x[53]>>x[54]>>x[55]>>x[56]>>x[57]>>x[58]>>x[59]>>x[60]>>x[61]>>x[62]>>x[63]){

//        for(int i=0; i<64; i++){
//            cin>>x[i];
////            if(x[i]==EOF){
////                flag=0;
////                break;
////            }
//        }
////        if(flag!=1){
////            break;
////        }
//        
        int first=-1;
        for(int i=0; i<64; i++){
            if(x[i]=='1'){
                first=i;
                break;
            }
        }
//        if(first==-1){
//            break;
//        }
        
        if(x[first+1]=='1'){
            if(x[first+2]=='1'){
                cout<<"C"<<endl;
            }else if(x[first+7]=='1'){
                cout<<"G"<<endl;
            }else if(x[first+10]=='1'){
                cout<<"E"<<endl;
            }else{
                cout<<"A"<<endl;
            }
        }else{
            if(x[first+7]=='1'){
                cout<<"D"<<endl;
            }else if(x[first+9]=='1'){
                cout<<"F"<<endl;
            }else{
                cout<<"B"<<endl;
            }
        }
        
        
    }
    
    return 0;
}

C++: #include<iostream>
using namespace std;
#define rep(i,a) for(int i = 0 ; i < a ; i ++)
int main(void){
  char maze[9][9];
  while(true){
    rep(i,8)rep(j,8)cin>>maze[i][j];
    if(cin.eof())break;
    bool used = false;
    rep(y,8){
      rep(x,8){
	if (board[y][x] == '1') {
	  if (board[y][x+1] == '1' && board[y+1][x] == '1' && board[y+1][x+1] == '1')
	    cout << "A" << endl;
	  else if (board[y+1][x] == '1' && board[y+2][x] == '1' && board[y+3][x] == '1')
	    cout << "B" << endl;
	  else if (board[y][x+1] == '1' && board[y][x+2] == '1' && board[y][x+3] == '1')
	    cout << "C" << endl;
	  else if (board[y+1][x] == '1' && board[y+1][x-1] == '1' && board[y+2][x-1] == '1')
	    cout << "D" << endl;
	  else if (board[y][x+1] == '1' && board[y+1][x+1] == '1' && board[y+1][x+2] == '1')
	    cout << "E" << endl;
	  else if (board[y+1][x] == '1' && board[y+1][x+1] == '1' && board[y+2][x+1] == '1')
	    cout << "F" << endl;
	  else
	    cout << "G" << endl;
	  used = true;
	}
	/*
	  if(maze[y][x]=='1'){
	  if(maze[ y ][x+1] == '1' && maze[y+1][ x ] =='1' &&
	  maze[y+1][x+1] =='1') cout << "A" << endl;
	  else if(maze[y+1][ x ] == '1' && maze[y+2][ x ] == '1' &&
	  maze[y+3][ x ] == '1') cout << "B" << endl;
	  else if(maze[ y ][x+3] == '1' && maze[y][x+2] == '1' &&
	  maze[ y ][x+1] == '1') cout << "C" << endl;
	  else if(maze[y+1][ x ] == '1' && maze[y+1][x-1] == '1' &&
	  maze[y+2][x-1] == '1') cout << "D" << endl;
	  else if(maze[ y ][x+1] == '1' && maze[y+1][x+1] == '1' &&
	  maze[y+1][x+2] == '1') cout << "E" << endl;
	  else if(maze[y+1][ x ] == '1' && maze[y+1][+1] == '1' &&
	  maze[y+2][x+1] == '1') cout << "F" << endl;
	  else cout << "G" << endl;
	  used = true;
	  }
	*/
	if(used)break;
      }
      if(used)break;
    }
  }

  return 0;
}