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

/*
0123
456
78
9
*/
const int data[7][10] = {
						{1, 1, 0, 0, 1, 1, 0, 0, 0, 0},
						{1, 0, 0, 0, 1, 0, 0, 1, 0, 1},
						{1, 1, 1, 1, 0, 0, 0, 0, 0, 0},
						{0, 1, 0, 0, 1, 1, 0, 1, 0, 0},
						{1, 1, 0, 0, 0, 1, 1, 0, 0, 0},
						{1, 0, 0, 0, 1, 1, 0, 0, 1, 0},
						{0, 1, 1, 0, 1, 1, 1, 0, 0, 0}
						};

const int change[10][2] = {{0, 0}, {1, 0}, {2, 0}, {3, 0}, {0, 1}, {1, 1}, {2, 1}, {0, 3}, {1, 3}, {0, 4}};

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);

	while(1){
		int c[15][15];
		for(int i = 0; i < 15; ++i){
			for(int j = 0; j < 15; ++j){
				c[j][i] = 0;
			}
		}

		for(int i = 0; i < 8; ++i){
			for(int j = 0; j < 8; ++j){
				char c0;
				cin >> c0;
				c[j][i] = (c0 == '0') ? 0 : 1;
			}
		}

		if(cin.eof()){
			break;
		}

		bool check2 = false;
		for(int i = 0; i < 8; ++i){
			for(int j = 0; j < 8; ++j){
				for(int k = 0; k < 7; ++k){
					bool check = true;
					for(int l = 0; l < 10; ++l){
						if(c[j + change[l][0]][i + change[l][1]] != data[k][l]){
							check = false;
							break;
						}
					}
					if(check){
						cout << char('A' + k) << endl;
						check2 = true;
						break;
					}
				}
				if(check2) break;
			}
			if(check2) break;
		}
	}

	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;
  while(true) {
      f=0;
	  for (i=0;i<8;i++) {
		  if (gets(c[i])==NULL) { i=10; break;}
		  if (f==0) for (j=0;j<8;j++) if (c[i][j]=='1') { f=1; x=j; y=i; j=9;}
	  }
	  if (i==10) break;
	  cout << endl;
	  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) 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<cstdio>
#include<iostream>

using namespace std;

int main(void){

	int block[7][3*2]={
		{ 1, 0,  0, 1,  1, 1},
		{ 0, 1,  0, 2,  0, 3},
		{ 1, 0,  2, 0,  3, 0},
		{ 0, 1, -1, 1, -1, 2},
		{ 1, 0,  1, 1,  2, 1},
		{ 0, 1,  1, 1,  1, 2},
		{ 1, 0,  0, 1, -1, 1},
	};
	int field[8][8];
	int ycnt=0,xcnt=0;
	int swit=0,flag;
	int xsta,ysta;
	char inp;

	while(cin>>inp){

		if(inp=='0'){
			field[ycnt][xcnt]=0;
			xcnt++;
		}

		if(inp=='1'){
			field[ycnt][xcnt]=1;
			if(swit==0){
				xsta=xcnt;
				ysta=ycnt;
				swit=1;
			}
			xcnt++;
		}

		if(xcnt==8){
			xcnt=0;
			ycnt++;
		}

		if(ycnt==8){
			xcnt=0;
			ycnt=0;
			swit=0;
			for(int i=0;i<7;i++){
				flag=1;
				for(int j=0;j<6;j+=2){
					if(ysta+block[i][j+1]>=0&&ysta+block[i][j+1]<8&&xsta+block[i][j]>=0&&xsta+block[i][j]<8){
						if(field[ysta+block[i][j+1]][xsta+block[i][j]]!=1){
							flag=0;
						}
					}
					else{
						flag=0;
					}
				}
				if(flag==1){
					cout<<(char)('A'+i)<<endl;
					break;
				}
			}
		}
	}

	return 0;
}

C++: 00000000
00000000
01100000
00110000
00000000
00000000
00000000
00000000

00011110
00000000
00000000
00000000
00000000
00000000
00000000
00000000

00000000
00000000
00110000
00110000
00000000
00000000
00000000
00000000

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

int main(){
	int ax, ay;
	char f[12][12];
	bool flag = false;

	for(int y=0 ; y<12 ; y++){
		for(int x=0 ; x<12 ; x++){
			f[y][x] = 0;
		}
	}

	while( 1 ){
		for(int i=0 ; i<8 ; i++) {
			if( scanf("%s", f[i]) == EOF ){
				flag = true;
				break;
			}
		}
		if(flag) break;

		for(int i=0 ; i<64 ; i++){
			if(f[i/8][i%8]=='1'){
				ax = i%8;
				ay = i/8;
				break;
			}
		}
		if( f[ay+1][ax]=='1' && f[ay][ax+1]=='1' && f[ay+1][ax+1]=='1' ){
			printf("A\n");
		}else if( f[ay+1][ax]=='1' && f[ay+2][ax]=='1' && f[ay+3][ax]=='1' ){
			printf("B\n");
		}else if( f[ay][ax+1]=='1' && f[ay][ax+2]=='1' && f[ay][ax+3]=='1' ){
			printf("C\n");
		}else if( f[ay][ax+1]=='1' && f[ay+1][ax+1]=='1' && f[ay+1][ax+2]=='1' ){
			printf("E\n");
		}else if( f[ay+1][ax]=='1' && f[ay+1][ax+1]=='1' && f[ay+2][ax+1]=='1' ){
			printf("F\n");
		}else if( f[ay][ax+1]=='1' && f[ay+1][ax]=='1' && f[ay+1][ax-1]=='1' ){
			printf("G\n");
		}else if( f[ay+2][ax-1]=='1' && f[ay+1][ax]=='1' && f[ay+1][ax-1]=='1' ){
			printf("D\n");
		}
	}
}

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

int main() {


while(1){
	char a[8][8],ans;
int c[4],b[4],j=0;
for(int kk=0;kk<=3;kk++){
c[kk]=0;
b[kk]=0;
}
for(int k=0;k<=7;k++){
	for(int l=0;l<=7;l++){
		a[k][l]=0;
		cin>>a[k][l];
		if(a[k][l]=='1'){
			b[j]=k;
			c[j]=l;
			j=j+1;
		}
	}
}
if(b[1]==0&&c[1]==0){
	break;
}
if(c[3]==c[0]+1&&b[3]==b[0]+1){
	ans='A';
}
if(c[3]==c[0]&&b[3]==b[0]+3){
	ans='B';
}
if(c[3]==c[0]+3&&b[3]==b[0]){
	ans='C';
}
if(c[3]==c[0]-1&&b[3]==b[0]+2){
	ans='D';
}
if(c[3]==c[0]+2&&b[3]==b[0]+1){
	ans='E';
}
if(c[3]==c[0]+1&&b[3]==b[0]+2){
	ans='F';
}
if(c[3]==c[0]&&b[3]==b[0]+1){
	ans='G';
}
cout<<ans<<endl;

}
return 0;
}