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<string>
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
    char a[10][10];
    int x = 0;

    while(scanf("%s",a[x])!=EOF){
        if(x == 7){
            getchar();
            for(int i = 0;i < 8; i++){
                for(int j = 0;j < 8; j++){
                    if(a[i][j] == '1'&& a[i+1][j] == '1' && a[i][j+1] == '1' && a[i+1][j+1] == '1')printf("A\n");
                    if(a[i][j] == '1'&& a[i+1][j] == '1' && a[i+2][j] == '1' && a[i+3][j] == '1')printf("B\n");
                    if(a[i][j] == '1'&& a[i][j+1] == '1' && a[i][j+2] == '1' && a[i][j+3] == '1')printf("C\n");
                    if(a[i][j] == '1'&& a[i][j+1] == '1' && a[i-1][j+1] == '1' && a[i+1][j] == '1')printf("D\n");
                    if(a[i][j] == '1'&& a[i][j+1] == '1' && a[i+1][j+1] == '1' && a[i+1][j+2] == '1')printf("E\n");
                    if(a[i][j] == '1'&& a[i+1][j] == '1' && a[i+1][j+1] == '1' && a[i+2][j+1] == '1')printf("F\n");
                    if(a[i][j] == '1'&& a[i][j+1] == '1' && a[i-1][j+1] == '1' && a[i-1][j+2] == '1')printf("G\n");
                }
            }
            x = 0;
        }
        else {
            x++;
        }
    }
    return 0;
}

C++: #include<iostream>
#include<string>
#include<stdio.h>
using namespace std;
char data[8][8];


struct P{
	P(){};
	P(int a,int b){
		x=a;
		y=b;
	}
	int x,y;
};

bool input(){
	for(int i=0;i<8;i++){
		if( scanf( "%s",data[i] ) == EOF )return false;
	}
	return true;
}
int main(){
	
	while(input()){
		P o=P(-1,-1);
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(data[i][j]=='1'){
					o=P(j,i);
					goto suc;
				}
			}
		}
		suc:;
		{
			for(int i=0;i<2;i++){
				for(int j=0;j<2;j++){
					if(o.y+i>=8 || o.x+j>=8)goto fail1;
					if(data[o.y+i][o.x+j]!='1')goto fail1;
				}
			}
			cout<<"A"<<endl;
			continue;
			fail1:;
		}
		{
			for(int i=0;i<4;i++){
				if(o.y+i>=8)goto fail2;
				if(data[o.y+i][o.x]!='1')goto fail2;
			}
			cout<<"B"<<endl;
			continue;
			fail2:; 
		}
		{
			for(int i=0;i<4;i++){
				if(o.x+i>=8)goto fail3;
				if(data[o.y][o.x+i]!='1')goto fail3;
			}
			cout<<"C"<<endl;
			continue;
			fail3:;
		}
		{
			if(o.y+2>=8 || o.x-1<=0)goto fail4;
			if(data[o.y+1][o.x]!='1')goto fail4;
			if(data[o.y+1][o.x-1]!='1')goto fail4;
			if(data[o.y+2][o.x-1]!='1')goto fail4;
			cout<<"D"<<endl;
			continue;
			fail4:;
		}
		{
			if(o.x+2>=8 || o.y+1>=8)goto fail5;
			if(data[o.y][o.x+1]!='1')goto fail5;
			if(data[o.y+1][o.x+1]!='1')goto fail5;
			if(data[o.y+1][o.x+2]!='1')goto fail5;
			cout<<"E"<<endl;
			continue;
			fail5:;
		}
		{
			if(o.x+1>=8 || o.y+2>=8)goto fail6;
			if(data[o.y+1][o.x]!='1')goto fail6;
			if(data[o.y+1][o.x+1]!='1')goto fail6;
			if(data[o.y+2][o.x+1]!='1')goto fail6;
			cout<<"F"<<endl;
			continue;
			fail6:;
		}
		{
			if(o.x!=-1)cout<<"G"<<endl;
		}
	}
}

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<8;i++){
      for(int j=0;j<8;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<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;
}

C++: #include<iostream>
#include<vector>
int main(){
	std::vector<std::vector<int> > vec(8,std::vector<int>(8));
	while(1){
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				std::cin>>vec[i][j];
			}
		}
		if(std::cin.eof())break;
		for(int i=0;i<8;i++){
			for(int j=0;j<8;j++){
				if(vec[i][j]==1){
					if(vec[i][j+1]==1&&vec[i+1][j]==1&&vec[i+1][j+1]==1)std::cout<<"A"<<std::endl;
					if(vec[i+1][j]==1&&vec[i+2][j]==1&&vec[i+3][j]==1)std::cout<<"B"<<std::endl;
					if(vec[i][j+1]==1&&vec[i][j+2]==1&&vec[i][j+3]==1)std::cout<<"C"<<std::endl;
					if(vec[i+1][j]==1&&vec[i+1][j-1]==1&&vec[i+2][j-1]==1)std::cout<<"D"<<std::endl;
					if(vec[i][j+1]==1&&vec[i+1][j+1]==1&&vec[i+1][j+2]==1)std::cout<<"E"<<std::endl;
					if(vec[i+1][j+1]==1&&vec[i+1][j+1]==1&&vec[i+2][j+1]==1)std::cout<<"F"<<std::endl;
					if(vec[i][j+1]==1&&vec[i+1][j]==1&&vec[i+1][j-1]==1)std::cout<<"G"<<std::endl;
				}
			}
		}
	}
	return 0;
}