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)
		fmt.Scanln()
	}
}

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

string s[10];

int main() {
	while(1){
		int t = 0;
		int r = 0;
		bool flag = false;
		for (int i = 0; i < 8; i++) {
			if (!(cin >> s[i]))return 0;
		}
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++)
			{
				if (s[i][j] == '1') {
					if (flag == false) { t = 8 * i + j; flag = true; };
					r += 8 * i + j;
				}
			}
		}
		r -= 4 * t;
		if (r == 18)cout << 'A' << endl;
		else if (r == 48)cout << 'B' << endl;
		else if (r == 6)cout << 'C' << endl;
		else if (r == 30)cout << 'D' << endl;
		else if (r == 20)cout << 'E' << endl;
		else if (r == 34)cout << 'F' << endl;
		else if (r == 16)cout << 'G' << endl; }
}

C++: #include<cstdio>
#include<cstring>

int main(){
	char p[7][19] = {"1100000011", "10000000100000001", "1111", "1000000110000001", "11000000011", "100000001100000001", "110000011"};
	char f[65];
	char t;
	while(1 + scanf("%c", &t)){
		if(t-10){
			f[0] = t;
		}else{
			scanf("%c", &f[0]);
		}
		for(int i = 1; i < 64; i++){
			scanf("%c", &t);
			if(t == 10){
				scanf("%c", &t);
			}
			f[i] = t;
		}
		f[64] = '\0';
		for(int i = 0; i < 7; i++){
			if(strstr(f, p[i])){
				printf("%c\n", i + 'A');
			}
		}
	}
	return 0;
}

C++: #include <iostream>
#include <vector>
#include <algorithm>
#include <string>

using namespace std;

const int Ax[]={0,0,1,1};
const int Ay[]={0,1,0,1};
const int Bx[]={0,0,0,0};
const int By[]={0,1,2,3};
const int Cx[]={0,1,2,3};
const int Cy[]={0,0.0,0};
const int Dx[]={0,0,-1,-1};
const int Dy[]={0,1,1,2};
const int Ex[]={0,1,1,2};
const int Ey[]={0,0,1,1};
const int Fx[]={0,0,1,1};
const int Fy[]={0,1,1,2};
const int Gx[]={0,1,-1,0};
const int Gy[]={0,0,1,1};


char field[8][8];

string check(int x,int y){
	if(field[y][x]=='1'){
		bool f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Ax[k];
			int ny=y+Ay[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "A";
		}
		f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Bx[k];
			int ny=y+By[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "B";
		}
		f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Cx[k];
			int ny=y+Cy[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "C";
		}
		f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Dx[k];
			int ny=y+Dy[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "D";
		}
		f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Ex[k];
			int ny=y+Ey[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "E";
		}
		f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Fx[k];
			int ny=y+Fy[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "F";
		}
		f=true;
		// ¡ÌÀW©çTõ
		for(int k = 0; k < 4; k++){
			int nx=x+Gx[k];
			int ny=y+Gy[k];
			if(nx>=0&&ny>=0&&nx<8&&ny<8){
				if(field[ny][nx]!='1'){
					f=false;
					break;
				}
			}
			else{
				f=false;
				break;
			}
		}
		if(f){
			return "G";
		}
	}
	return "";
}

int main(){


	while(1){
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				cin>>field[i][j];
			}
		}
		if(cin.eof())
			break;
		bool f=false;
		for(int i = 0; i < 8; i++){
			for(int j = 0; j < 8; j++){
				string ret=check(j,i);
				string com="";
				if(ret!=com){
					cout<<ret<<endl;
					f=true;
					break;
				}
			}
			if(f)
				break;
		}
	}

	return 0;
}

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

int main(){
	string line[8];

	while(1){


		int w = 0, h = 0, t=-1;

		for(int i=0;i<8;++i)
			cin >> line[i];

		int right=0,left=7;

		for(int i=0;i<8;++i){
			bool exist = false;
			for(int j=0;j<8;++j){
				if((line[i])[j] == '1'){
					if(t!=-1)t=i;
					if(j>right)right = j;
					if(j<left)left = j;
					exist = true;
				}
			}
			if(exist)++h;
		}
		w = right - left + 1;

		if( w == 2 && h == 2 )cout<<"A"<<endl;
		else if(w == 1)cout<<"B"<<endl;
		else if(h == 1)cout<<"C"<<endl;


		else if(w==2){
			for(int i=0;i<8;++i){
				if((line[i])[left] == '1'){
					if((line[i])[left+1]=='1')
						cout<<"D"<<endl;
					else
						cout<<"F"<<endl;
					break;
				}
			}
		}

		else if(h==2){
			for(int i=0;i<8;++i){
				if((line[t])[i]=='1'){
					if((line[t+1])[i]=='1')
						cout<<"G"<<endl;
					else
						cout<<"E"<<endl;
				}
			}
		}

	}
	return 0;
}