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++: //a
#include <iostream>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <utility>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <string>
#include <cstring>
#include <climits>
 
#define REP(i,b,n) for(int i=b;i<n;++i)
#define REPR(i,b,n) for(int i=n-1;i>=b;--i)
#define CLR(mat) memset(mat, 0, sizeof(mat))
#define NCLR(mat) memset(mat, -1, sizeof(mat))
#define EACH(i, c) for(typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define BIT(n, b) ((n>>b) & 1)
#define PI acos(-1.0)

using namespace std;

static const double EPS = 1e-9;
typedef pair<double, int> stn;
typedef long long ll;

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

int main(){
	
	while(!cin.eof()){
	
		char ans = 0;
		vector<string> surf = vector<string>(16, "0000000000000000");
		
		for(int i = 0; i < 8; ++i){
		
			string str;
			cin >> str;
			surf[i] = str;
		}
		
		for(int y = 0; y < 8; ++y){
			for(int x = 0; x < 8; ++x){
				
				if(surf[y][x] == '1'){
					for(int k = 0; k < 7; ++k){
						
						int cnt = 0;
						
						for(int i = 0; i < 16; ++i){
							if( ptn[k][i] == surf[y+i/4][x+i%4] )
								cnt++;
							else
								break;
						}
						
						if(cnt>=16){
							ans = char('A'+k);
							goto out;
						}
						
					}
				}
				
			}
		}
		
	out:
		if(ans)
			cout << ans << endl;
	}
	
	return 0;
}

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

string map[8];

void check( int x, int y ){
	int blocks[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}}
	};
	for( int i=0; i<7; i++ ){
		bool match = true;
		for( int j=0; j<3; j++ ){
			int xx = x+blocks[i][j][0];
			int yy = y+blocks[i][j][1];
			if( xx<0 || xx>=8 || yy<0 || yy>=8 ){
				match = false;
				break;
			}
			if( map[yy][xx] == '0' ){
				match = false;
			}
		}
		if( match ){
			cout << (char)('A'+i) << endl;
			break;
		}
	}
}

int main(){
	while(1){
		int k = -1;
		for( int i=0; i<8; i++ ){
			getline( cin, map[i] );
			if( map[i].length() != 8 )	return 0;
			if( k==-1 && map[i]!="00000000" ){
				k = i;
			}
		}
		for( int i=0; i<8; i++ ){
			if( map[k][i] == '1' ){
				check(i, k);
				break;
			}
		}
		string br;
		getline( cin, br );
	}
	return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
int main(){
	while(1){
		int b[8][8]={0};
		string str;
		for(int i=0;i<8;i++){
			cin>>str;
			for(int j=0;j<8;j++){
				b[i][j]=str[j]-48;
			}
		}
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(b[i][j] && b[i+1][j] && b[i][j+1] && b[i+1][j+1]){
					cout<<"A"<<endl;
					goto label;
				}else if(b[i][j] && b[i+1][j] && b[i+2][j] && b[i+3][j]){ 
					cout<<"B"<<endl;
					goto label;
				}else if(b[i][j] && b[i][j+1] && b[i][j+2] && b[i][j+3]){
					cout<<"C"<<endl;
					goto label;
				}else if(b[i][j] && b[i+1][j] && b[i+1][j-1] && b[i+2][j-1]){
					cout<<"D"<<endl;
					goto label;
				}else if(b[i][j] && b[i][j+1] && b[i+1][j+1] && b[i+1][j+2]){
					cout<<"E"<<endl;
					goto label;
				}else if(b[i][j] && b[i+1][j] && b[i+1][j+1] && b[i+2][j+1]){
					cout<<"F"<<endl;
					goto label;
				}else if(b[i][j] && b[i][j+1] && b[i+1][j] && b[i+1][j-1]){ 
					cout<<"G"<<endl;
					goto label;
				}
			}
		}
		label:;
	}
	return 0;
}

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

class Point{
public:
  int x, y;
  Point(int x = 0, int y = 0) : x(x), y(y) {}
};

int main() {
  static Point blocks[7][4];
  blocks[0][0] = Point(0, 0);
  blocks[0][1] = Point(1, 0);
  blocks[0][2] = Point(0, 1);
  blocks[0][3] = Point(1, 1);
  blocks[1][0] = Point(0, 0);
  blocks[1][1] = Point(0, 1);
  blocks[1][2] = Point(0, 2);
  blocks[1][3] = Point(0, 3);
  blocks[2][0] = Point(0, 0);
  blocks[2][1] = Point(1, 0);
  blocks[2][2] = Point(2, 0);
  blocks[2][3] = Point(3, 0);
  blocks[3][0] = Point(1, 0);
  blocks[3][1] = Point(0, 1);
  blocks[3][2] = Point(1, 1);
  blocks[3][3] = Point(0, 2);
  blocks[4][0] = Point(0, 0);
  blocks[4][1] = Point(1, 0);
  blocks[4][2] = Point(1, 1);
  blocks[4][3] = Point(2, 1);
  blocks[5][0] = Point(0, 0);
  blocks[5][1] = Point(0, 1);
  blocks[5][2] = Point(1, 1);
  blocks[5][3] = Point(1, 2);
  blocks[6][0] = Point(1, 0);
  blocks[6][1] = Point(2, 0);
  blocks[6][2] = Point(0, 1);
  blocks[6][3] = Point(1, 1);

  string data[8];
  while(getline(cin, data[0])) {
    for(int i = 1; i < 8; i++) {
      getline(cin, data[i]);
    }
    getchar();
    for(int i = 0; i < 8; i++) {
      for(int j = 0; j < 8; j++) {
	if(data[i][j] == '1') {
	  for(int n = 0; n < 7; n++) {
	    bool flag = true;
	    int ox = j - blocks[n][0].x;
	    int oy = i - blocks[n][0].y;
	    for(int p = 1; p < 4; p++) {
	      int nx = ox+blocks[n][p].x;
	      int ny = oy+blocks[n][p].y;
	      if(nx < 0 || nx >= 8 || ny < 0 || ny >= 8) {
		flag = false;
		break;
	      }

	      if(data[ny][nx] != '1') {
	        flag = false;
	        break;
	      }
	    }
	    if(flag) {
	      cout << (char)((int)'A'+n) << endl;
	      break;
	    }
	  }
	  i = 8;
	  break;
        }
      }
    }
  }
  return 0;
}