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 <string>
using namespace std;

#define SIZE 8

int main() {
	string source[SIZE];
	while (!cin.eof()) {
		for (int i = 0; i < SIZE; i++) {
			cin >> source[i];
		}

		bool map[14][14];
		int x = SIZE - 1, y = SIZE - 1;
		for (int i = 0; i < SIZE; i++) {
			for (int j = 0; j < SIZE; j++) {
				map[i + 3][j + 3] = (source[i][j] == '1' ? true : false);
				if (source[i][j] == '1' && j < x && i < y) {
					x = j;
					y = i;
				}
			}
		}
		x += 3;
		y += 3;

		if (map[y + 1][x + 1]) {
			if (map[y][x + 1] && map[y + 1][x]) {
				cout << "A";
			} else if (map[y + 2][x + 1] && map[y + 1][x]) {
				cout << "F";
			} else if (map[y + 1][x + 2] && map[y][x + 1]) {
				cout << "E";
			}
		}
		if (map[y - 1][x - 1]) {
			if (map[y][x + 1] && map[y + 1][x]) {
				cout << "G";
			} else if (map[y + 2][x - 1] && map[y + 1][x]) {
				cout << "D";
			}
		}
		if (map[y + 1][x] && map[y + 2][x] && map[y + 3][x]) {
			cout << "B";
		}
		if (map[y][x + 1] && map[y][x + 2] && map[y][x + 3]) {
			cout << "C";
		}
		cout << endl;
	}
	return 0;
}

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() {
	vector< vector<Point> > figs = { 
		{Point(0,0),Point(1,0),Point(0,1),Point(1,1)},
		{Point(0,0),Point(0,1),Point(0,2),Point(0,3)},
		{Point(0,0),Point(1,0),Point(2,0),Point(3,0)},
		{Point(0,0),Point(-1,1),Point(0,1),Point(-1,2)},
		{Point(0,0),Point(1,0),Point(1,1),Point(2,1)},
		{Point(0,0),Point(0,1),Point(1,1),Point(1,2)},
		{Point(0,0),Point(1,0),Point(-1,1),Point(0,1)}
	};
	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 <cstdio>

using namespace std;

char fig [9][9];

int main()
{
	
	while (scanf("%s", fig[0]) != EOF){
		for (int i = 1; i < 8; i++){
			scanf("%s", fig[i]);
		}
		
		for (int y = 0; y < 8; y++){
			for (int x = 0; x < 8; x++){
				if (fig[y][x] != '0'){
					if (fig[y][x + 1] == '1' && fig[y + 1][x] == '1' && fig[y + 1][x + 1] == '1'){
						printf("A\n");
						y = 10;
						break;
					}
					else if(fig[y + 1][x] == '1' && fig[y + 2][x] == '1' && fig[y + 3][x] == '1'){
						printf("B\n");
						y = 10;
						break;
					}
					else if(fig[y][x + 1] == '1' && fig[y][x + 2] == '1' && fig[y][x + 3] == '1'){
						printf("C\n");
						y = 10;
						break;
					}
					else if(fig[y + 1][x] == '1' && fig[y + 1][x - 1] == '1' && fig[y + 2][x - 1] == '1'){
						printf("D\n");
						y = 10;
						break;
					}
					else if(fig[y][x + 1] == '1' && fig[y + 1][x + 1] == '1' && fig[y + 1][x + 2] == '1'){
						printf("E\n");
						y = 10;
						break;
					}
					else if(fig[y + 1][x] == '1' && fig[y + 1][x + 1] == '1' && fig[y + 2][x + 1] == '1'){
						printf("F\n");
						y = 10;
						break;
					}
				}
			}
		}
	}
}

C++: #include <bits/stdc++.h>
using namespace std;

int main() {
  string str[8];
  while(1) {
    for ( int i = 0; i < 8; i++ ) cin >> str[i];
    if ( cin.eof() ) return 0;
    char ans;
    for ( int i = 0; i < 8; i++ ) {
      for ( int j = 0; j < 8; j++ ) {
      if ( str[i][j] == '1' && str[i][j+1] == '1' && 
	   str[i+1][j] == '1' && str[i+1][j+1] == '1' ) ans = 'A';
      else if ( str[i][j] == '1' && str[i+1][j] == '1' &&
		str[i+2][j] == '1' && str[i+3][j] =='1' ) ans = 'B';
      else if ( str[i][j] == '1' && str[i][j+1] == '1' &&
		str[i][j+2] == '1' && str[i][j+3] == '1' ) ans = 'C';
      else if ( str[i][j] == '1' && str[i+1][j-1] == '1' &&
		str[i+1][j] == '1' && str[i+2][j-1] == '1' ) ans = 'D';
      else if ( str[i][j] == '1' && str[i][j+1] == '1' &&
		str[i+1][j+1] == '1' && str[i+1][j+2] == '1' ) ans = 'E';
      else if ( str[i][j] == '1' && str[i+1][j] == '1' &&
		str[i+1][j+1] == '1' && str[i+2][j+1] == '1' ) ans = 'F';
      else if ( str[i][j] == '1' && str[i][j+1] == '1' &&
		str[i+1][j-1] == '1' && str[i+1][j] == '1' ) ans = 'G';
							 
      }
    }
    cout << ans << endl;
  }
  return 0;
}

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

char n[12][12];
char figure[7][4][5] = {
	{"1100","1100","0000","0000"},
	{"1000","1000","1000","1000"},
	{"1111","0000","0000","0000"},
	{"0100","1100","1000","0000"},
	{"1100","0110","0000","0000"},
	{"1000","1100","0100","0000"},
	{"0110","1100","0000","0000"}
};


void clear(){
	for(int i=0; i<12; i++)
			n[i][8]='0';
}

int main(){
	for(int i=0; i<12; i++)
		for(int j=0; j<12; j++)
			n[i][j]='0';

	while(~scanf("%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n%8s\n\n", n[0], n[1], n[2], n[3], n[4], n[5], n[6], n[7])){
		clear();
		for(int i=0; i<7; i++){
			for(int j=0; j<8; j++){
				for(int k=0; k<8; k++){
					bool flag=true;
					
					for(int x=0; x<4; x++){
						for(int y=0; y<4; y++){
							if(figure[i][x][y] != n[j+x][k+y]) flag = false;
						}
					}
					
					if(flag){
						cout << (char)('A'+i) << endl;
					}

				}
			}
		}
	}
	return 0;
}