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(), "")
		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++: #include <iostream>
#include <fstream>
#include <sstream>
#include <iomanip> 
#include <complex> 
#include <string>
#include <vector> 
#include <list>
#include <deque> 
#include <stack> 
#include <queue> 
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <utility>
#include <algorithm> 
#include <numeric> 
#include <typeinfo> 
#include <cstdio>
#include <cstdlib> 
#include <cstring>
#include <cmath>
#include <climits> 
#include <ctime>

using namespace std;

char field[11][11],field2[11][11];

int main(void){
	while(1){
		int i,j;
		bool flag=false;
		for(j=0;j<11;j++){
			for(i=0;i<11;i++){
				field[i][j]='\0';
				field2[i][j]='\0';
			}
		}
		for(i=0;i<8;i++){
			if(scanf("%s",field[i])==EOF){
				flag=true;
				break;
			}
			if(flag)break;
		}
		for(j=0;j<8;j++){
			for(i=0;i<8;i++){
				field2[i][j]=field[j][i];
			}
		}
		for(j=0;j<8;j++){
			for(i=0;i<8;i++){
				if(field2[i][j]=='1' && field2[i+1][j]=='1' && field2[i][j+1]=='1' && field2[i+1][j+1]=='1')printf("A\n");
				if(field2[i][j]=='1' && field2[i][j+1]=='1' && field2[i][j+2]=='1' && field2[i][j+3]=='1')printf("B\n");
				if(field2[i][j]=='1' && field2[i+1][j]=='1' && field2[i+2][j]=='1' && field2[i+3][j]=='1')printf("C\n");
				if(field2[i+1][j]=='1' && field2[i+1][j+1]=='1' && field2[i][j+1]=='1' && field2[i][j+2]=='1')printf("D\n");
				if(field2[i][j]=='1' && field2[i+1][j]=='1' && field2[i+1][j+1]=='1' && field2[i+2][j+1]=='1')printf("E\n");
				if(field2[i][j]=='1' && field2[i][j+1]=='1' && field2[i+1][j+1]=='1' && field2[i+1][j+2]=='1')printf("F\n");
				if(field2[i][j+1]=='1' && field2[i+1][j+1]=='1' && field2[i+1][j]=='1' && field2[i+2][j]=='1')printf("G\n");
			}
		}
	}
	return 0;
}

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


int main(int argc,char* argv[]){
		std::string ans[7] ={"1100000011","1000000010000000100000001","1111","1000000110000001","11000000011","100000001100000001","110000011"};
		std::string alpha[7]={"A","B","C","D","E","F","G"};
		std::string prob[8];
		std::string problem;

		while(std::cin >> prob[0]){
						for(int a=1; a < 8; a++){
										std::cin >> prob[a];
						}
						for(int b=0; b < 8; b++){
										problem = problem + prob[b];
						}
						for(int c=0; c < 7; c++){
										std::string::size_type index = problem.find(ans[c]);
										if(index != std::string::npos){
														std::cout << alpha[c] << std::endl;
										}
						}
						problem ="";
		}
}

C++: #include<stdio.h>

char grid[8][8];
int vecx[7][3] = { { 0, 1, 1 }, { 0, 0, 0 }, { 1, 2, 3 }, { 0, -1, -1 }, { 1, 1, 2 }, { 0, 1, 1 },{ 1, -1, 0 } };
int vecy[7][3] = { { 1, 0, 1 }, { 1, 2, 3 }, { 0, 0, 0 }, { 1, 1, 2 }, { 0, 1, 1 }, { 1, 1, 2 }, { 0, 1, 1 } };

int main()
{
	while( 1 ){
	
		for( int i = 0; i < 8; i++ )if( scanf( "%s", grid[i] ) == EOF ) goto end;
	
		for( int i = 0; i < 8; i++ ){
		 	for( int j = 0; j < 8; j++ ){
				if( grid[i][j] == '1' ){
					for( int k = 0; k < 7; k++ ){
						if( grid[i+vecy[k][0]][j+vecx[k][0]] == '1' 
						 && grid[i+vecy[k][1]][j+vecx[k][1]] == '1' 
						 && grid[i+vecy[k][2]][j+vecx[k][2]] == '1' )
							printf( "%c\n", 'A' + k );	
					}
				}
			}
		}
	}

end:

 	return 0;
}

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

int main() {
 NEXT:
  char x;
  int k=0;
  while(1) {
    cin.get(x);
    if(x == '1') {
      k = k % 7;
      break;
    }
    k++;
  }
  cin.get(x);
  if(x == '1') {// A,C,E,G
    cin.get(x);
    if(x == '1') // C
      cout << "C" << endl;
    else if(x == '0') {//A,E,G
      for(int i=0;i<6;i++){
        cin.get(x);
      }
      if(x == '1')
        cout << "G" << endl; // G
      else if(x == '0') {
        cin.get(x);
        if(x == '1')
          cout << "A" << endl; // A
        else
          cout << "E" << endl; // E
      }
    }
  }
  else if(x == '0') {//B,D,F
    for(int i=0;i<6;i++) {
      cin.get(x);
    }
    if(x == '1')
      cout << "D" << endl;
    else if(x == '0') {
      cin.get(x);
      cin.get(x);
      if(x == '1')
        cout << "F" << endl;
      else
        cout << "B" << endl;
    }
  }
  while(1) {
    cin.get(x);
    if(x == '\n') {
      cin.get(x);
      if(x == '\n')
        goto NEXT;
    }
  }
}

C++: #include <iostream>
int main(){
	while(1){
		std::string s[8];

		int x = 0,y = 0;
		for(int i=0;i<8;i++){
			std::cin >> s[i];
			if(std::cin.eof())return 0;
		}
		
		for(int i=0;i<64;i++)
			if(s[i/8][i%8] == '1'){x=i%8,y=i/8;break;}

		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 && y+1 < 8 && s[y+1][x+1] == '1'){
				res = 'E';
			}
			else{
			res = 'C';
			}
		}

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