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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; 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 < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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 < 8; i++ {
			for j := 0; j < 8; 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<stdio.h>
 #include<string>
 #include<math.h>
 #include<iomanip>
 #include<algorithm>
 #include<string.h>
 #include<cctype>
 #include<map>
 #include<set>
 #include<vector>
 #include<sstream>
 #include<stack>
 #include<queue>
 
 using namespace std;

 int arr[8][8];
 
 int main()
 {
   while(cin>>arr[0][0])
   {
     int x[4],y[4];
     int cnt1,cnt2;
     cnt1=cnt2=0;
     if(arr[0][0]==1)
     {
       x[cnt1++]=0;
       y[cnt2++]=0;                
     }
     for(int i=0;i<8;i++)
     {
       for(int j=0;j<8;j++)
       {
         if(i==0&&j==0) continue;
         else
         {
           if(arr[i][j]==1)
           {
             x[cnt1++]=i;
             y[cnt2++]=j;                
           }    
         }        
       }        
     }             
     if(y[0]==y[1]&&y[2]==y[3]&&x[1]==x[0]+1&&x[3]==x[2]+1) cout<<"A"<<endl;
     else if(x[0]==x[1]&&x[1]==x[2]&&x[2]==x[3]) cout<<"B"<<endl;
     else if(y[0]==y[1]&&y[1]==y[2]&&y[2]==y[3]) cout<<"C"<<endl;
     else if(y[1]==y[2]&&x[0]==x[3]+1) cout<<"D"<<endl;
     else if(x[1]==x[2]&&x[3]==x[0]+2) cout<<"E"<<endl;
     else if(y[1]==y[2]&&y[3]==y[0]+1) cout<<"F"<<endl;
     else cout<<"G"<<endl;        
   }
   //while(1);
   return 0;
 }

C++: #include <iostream>

using namespace std;

char p[8][9];

bool m(int i, int j) {
  return 0 <= i && i < 8 && 0 <= j && j < 8 && p[i][j] == '1';
}

int main() {
  while (cin >> p[0], !cin.eof()) {
    for (int i = 1; i < 8; i++)
      cin >> p[i];
    for (int i = 0; i < 8; i++)
      for (int j = 0; j < 8; j++)
        if (m(i, j)) {
          if (m(i, j+1) && m(i+1, j) && m(i+1, j+1))
            cout << 'A' << endl;
          else if (m(i+1, j) && m(i+2, j) && m(i+3, j))
            cout << 'B' << endl;
          else if (m(i, j+1) && m(i, j+2) && m(i, j+3))
            cout << 'C' << endl;
          else if (m(i+1, j) && m(i+1, j-1) && m(i+2, j-1))
            cout << 'D' << endl;
          else if (m(i, j+1) && m(i+1, j+1) && m(i+1, j+2))
            cout << 'E' << endl;
          else if (m(i+1, j) && m(i+1, j+1) && m(i+2, j+1))
            cout << 'F' << endl;
          else
            cout << 'G' << endl;
          goto epilogue;
        }
epilogue:;
  }
}

C++: #include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

#define INF (1<<29)
#define EPS (1e-10)
#define make_pair mp
#define pb push_bacck

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pii;

int dx[] = {0,1,0,-1}, dy[] = {1,0,-1,0};
int bx[7][4] = {
							{0,1,0,1},
							{0,0,0,0},
							{0,1,2,3},
							{1,0,1,0},
							{0,1,1,2},
							{0,0,1,1},
							{1,2,0,1}};
int by[7][4] = {
							{0,0,1,1},
							{0,1,2,3},
							{0,0,0,0},
							{0,1,1,2},
							{0,0,1,1},
							{0,1,1,2},
							{0,0,1,1}};

int main(){
	string board[8];
	while (1) {
		for (int i = 0; i < 8; i++) {
			cin >> board[i];
		}
		for (int i = 0; i < 8; i++) {
			for (int j = 0; j < 8; j++) {
				for (int k = 0; k < sizeof(bx); k++) {
					bool ok = true;
					for (int l = 0; l < 4; l++) {
						int x = j+bx[k][l], y = i+by[k][l];
						if (x < 0 || 8 <= x || y < 0 || 8 <= y || board[y][x] != '1'){
							ok = false;
							break;
						}
					}
					if (ok) {
						cout << char('A'+k) << endl;
						goto end;
					}
				}
			}
		}
		end:;
	}
}

C++: #include<iostream>

using namespace std;

int A[7][4][4]={
  
  {
    {1,1,0,0},
    {1,1,0,0},
    {0,0,0,0},
    {0,0,0,0},
  },
  
  {
    {1,0,0,0},
    {1,0,0,0},
    {1,0,0,0},
    {1,0,0,0},
  },
  
  {
    {1,1,1,1},
    {0,0,0,0},
    {0,0,0,0},
    {0,0,0,0},
  },
  
  {
    {0,1,0,0},
    {1,1,0,0},
    {1,0,0,0},
    {0,0,0,0},
  },
  
  {
    {1,1,0,0},
    {0,1,1,0},
    {0,0,0,0},
    {0,0,0,0},
  },
  
  {
    {1,0,0,0},
    {1,1,0,0},
    {0,1,0,0},
    {0,0,0,0},
  },
  
  {
    {0,1,1,0},
    {1,1,0,0},
    {0,0,0,0},
    {0,0,0,0},
  },
},
  
  a[12][12];

string s="ABCDEFG";

void check(){


  for(int n=0;n<7;n++){

    for(int i=0;i<6;i++){
      for(int j=0;j<6;j++){
	bool fg=true;
	for(int k=0;k<4;k++){
	  for(int l=0;l<4;l++){
	    if(a[i+k][j+l]!=A[n][k][l]){
	      fg=false;
	      break;
	    }
	  }
	}
	if(fg){
	  cout << s[n] << endl;
	  return;
	}
	fg=true;

      }
    }
  }

}


int main(void){

  char ch;

  while(true){

    for(int i=0;i<12;i++)
      for(int j=0;j<12;j++)
	a[i][j]=0;
    
    for(int i=0;i<8;i++){
      for(int j=0;j<8;j++){
	cin.get(ch);
	if(cin.eof())return 0;
	a[i][j]=ch-'0';
      }
      cin.ignore();
    }
    check();
  }

  return 0;
}