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
}

var emptyBoard = [][]int{{0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0}}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, emptyBoard) {
			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 <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;
}

C++: #include <stdio.h>
#include <algorithm>

using namespace std;

int main(){
	char table[8][9];

	while(scanf("%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n",table[0],table[1],table[2],table[3],table[4],table[5],table[6],table[7])!=EOF){

		bool FLG = false;
		for(int i=0; i < 8; i++){
			for(int k=0; k<8; k++){
				if(table[i][k] == '1'){
					if(i <= 6 && k <= 6 && table[i][k+1] == '1' && table[i+1][k] == '1' && table[i+1][k+1] == '1'){
						printf("A\n");
						FLG = true;
						break;
					}else if(i <= 4 && table[i+1][k] == '1' && table[i+2][k] == '1' && table[i+3][k] == '1'){
						printf("B\n");
						FLG = true;
						break;
					}else if(k <= 4 && table[i][k+1] == '1' && table[i][k+2] == '1' && table[i][k+3] == '1'){
						printf("C\n");
						FLG = true;
						break;
					}else if(i <= 5 && k >= 1 && table[i+1][k-1] == '1' && table[i+1][k] == '1' &&
							table[i+2][k-1] == '1'){
						printf("D\n");
						FLG = true;
						break;
					}else if(i <= 6 && k <= 5 && table[i][k+1] == '1' && table[i+1][k+1] == '1' &&
							table[i+1][k+2] == '1'){
						printf("E\n");
						FLG = true;
						break;
					}else if(i <= 5 && k <= 6 && table[i+1][k] == '1' && table[i+1][k+1] == '1' &&
							table[i+2][k+1] == '1'){
						printf("F\n");
						FLG = true;
						break;
					}else if(i <= 6 && k <= 6 && k >= 1 && table[i][k+1] == '1' && table[i+1][k-1] == '1' &&
							table[i+i][k] == '1'){
						printf("F\n");
						FLG = true;
						break;
					}
				}
			}
			if(FLG)break;
		}
		getchar();
	}


	return 0;
}