Go: package main

import (
	"bufio"
	"os"
	"strings"
	"strconv"
	"fmt"
)

var scanner = bufio.NewScanner(os.Stdin)

func main() {
	var scanner = bufio.NewScanner(os.Stdin)
	board := make([][]int, 8)
	for i := range board {
		board[i] = make([]int, 8)
			for j := range board[i] {
				board[i][j] = 0
			}
	}
	var ans string
	for scanner.Scan() {
		tmp := strings.Split(scanner.Text(), "")
		for i := 0; i < 8; i++ {
			board[0][i], _ = strconv.Atoi(tmp[i])
		}
		for i := 1; i < 8; i++ {
			scanner.Scan()
			row := strings.Split(scanner.Text(), "")
			for j := 0; j < 8; j++ {
				board[i][j], _ = strconv.Atoi(row[j])
			}
		}
		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>
#include <cstdio>
using namespace std;

struct Point{
public:
	int x,y;
	Point(int _x, int _y){x=_x;y=_y;}
	void show(){cout<<x<<","<<y<<endl;}
	bool eq(Point &a){return x==a.x && y==a.y;}
};

bool eqFig(vector<Point> &a, vector<Point> &b){
	if(a.size()!=b.size()){
		return false;
	}else{
		vector<Point>::iterator ita=a.begin(), itb=b.begin();
		for(;ita<a.end();++ita,++itb){
			if(!(ita->eq(*itb))){
				return false;
			}
		}
		return true;
	}
}

int main() {
	Point fig_a[4] = {Point(0,0),Point(1,0),Point(0,1),Point(1,1)};
	Point fig_b[4] = {Point(0,0),Point(0,1),Point(0,2),Point(0,3)};
	Point fig_c[4] = {Point(0,0),Point(1,0),Point(2,0),Point(3,0)};
	Point fig_d[4] = {Point(0,0),Point(-1,1),Point(0,1),Point(-1,2)};
	Point fig_e[4] = {Point(0,0),Point(1,0),Point(1,1),Point(2,1)};
	Point fig_f[4] = {Point(0,0),Point(0,1),Point(1,1),Point(1,2)};
	Point fig_g[4] = {Point(0,0),Point(1,0),Point(-1,1),Point(0,1)};
	
	vector< vector<Point> > figs{
		vector<Point>(fig_a,fig_a+4),
		vector<Point>(fig_b,fig_b+4),
		vector<Point>(fig_c,fig_c+4),
		vector<Point>(fig_d,fig_d+4),
		vector<Point>(fig_e,fig_e+4),
		vector<Point>(fig_f,fig_f+4),
		vector<Point>(fig_g,fig_g+4)
	};
	vector<Point>fig;
	unsigned char ch;
	
	do{
		fig.clear();
		int x=0,y=0,sx;
		bool flg=false;
		
		for(int i=0;i<8;++i){
			for(int j=0;j<8;++j){
				ch = getchar();
				if(ch == '1'){
					fig.push_back(Point(x,y));
					if(!flg)sx = j;
					flg = true;
				}
				if(flg){
					x = 1 + j - sx;
				}
			}
			if(flg)++y;
			getchar();
		}
		
		for(int i=0;i<7;++i){
			if(eqFig(figs[i],fig)){
				cout<<(char)('A'+i)<<endl;
				break;
			}
		}
		
	}while(getchar()!=EOF);
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <cstring>
using namespace std;
bool field[8][8];
int x, y;

char solve(){
  if(field[y][x+1] && field[y+1][x] && field[y+1][x+1]) return 'A';
  if(field[y+1][x] && field[y+2][x] && field[y+3][x]) return 'B';
  if(field[y][x+1] && field[y][x+2] && field[y][x+3]) return 'C';
  if(field[y+1][x] && field[y+1][x-1] && field[y+2][x-1]) return 'D';
  if(field[y][x+1] && field[y+1][x+1] && field[y+1][x+2]) return 'E';
  if(field[y+1][x] && field[y+1][x+1] && field[y+2][x+1]) return 'F';
  if(field[y][x+1] && field[y+1][x-1] && field[y+1][x]) return 'G';
}


int main(){
  char ans;
  string tmp[8];
  
  while(cin >> tmp[0] >> tmp[1] >> tmp[2] >> tmp[3] >> tmp[4] >> tmp[5]
	>> tmp[6] >> tmp[7]){
    bool flag = 0;
    
    for(int i = 0 ; i < 8 ; i++){
      for(int j = 0 ; j < 8 ; j++){
	field[i][j] = tmp[i][j] - '0';
      }
    }
    
    for(y = 0 ; y < 8 ; y++){
      for(x = 0 ; x < 8 ; x++){
	if(field[y][x] && !flag){
	  cout << solve();
	  flag = 1;
	}
      }
    }
    cout << endl;
  }
  return 0;
}

C++: #include <iostream>
#include <string>
using namespace std;
string s[8];
void f(){
	char b='A';
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			if(s[i][j]=='1'){
				if(i<5)if(s[i+3][j]=='1')b='B';
				if(j<5)if(s[i][j+3]=='1')b='C';
				if(i<6&&j>0)if(s[i+2][j-1]=='1')b='D';
				if(i<7&&j<6)if(s[i+1][j+2]=='1')b='E';
				if(i<6&&j<7)if(s[i+2][j+1]=='1')b='F';
				if(i<7&&j>0)if(s[i+1][j-1]=='1')b='G';
				cout<<b<<endl;
				return;
			}
		}
	}
}

int main(){
	while(cin>>s[0]){
		for(int i=1;i<8;i++)cin>>s[i];
		f();
	}
	return 0;
}

C++: #include <iostream>
int main(){
	std::string s[8];
	int f = 0, e = 0;
	while(1){
		if(f)std::cout << "\n";
		else f = 1;

		int x = 0,y = 0;
		for(int i=0;i<8;i++){
			std::cin >> s[i];
			if(std::cin.eof())e=1;
		}

		if(e)return 0;
		
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++)
				if(s[i][j] == '1' && !x && !y)x=j,y=i;
		}

		char res;
		if(y+1 < 8 && s[y+1][x] == '1'){
			if(x-1 >= 0 && s[y+1][x-1] == '1'){
				if(x+1 < 8 && s[y][x+1] == '1'){
					res = 'G';
				}
				else{
					res = 'D';
				}
			}
			else if(x+1 < 8 && s[y+1][x+1] == '1'){
				if(s[y][x+1] == '1'){
					res = 'A';
				}
				else{
					res = 'F';
				}
			}
			else{
				res = 'B';
			}
		}
		else{
			if(x+1 < 8 && s[y+1][x+1] == '1'){
				res = 'E';
			}
			else{
			res = 'C';
			}
		}

		std::cout << res << std::endl;
	}
}