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
}

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>

using namespace std;

class Point{
public:
	int x,y;
	Point(){}
	Point( int dx, int dy ) : x( dx ), y( dy ) {}
};

Point place[7][4] = { { 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( 0, 1 ), Point( -1, 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( 0, 1 ), Point( -1, 1 ) } };

int main(int argc, char const* argv[])
{
	char data[10][10];

	while( true ){
		for( int i = 0;i < 10;i++ ){
			for( int j = 0;j < 10;j++ ){
				data[i][j] = 0;
			}
		}


		for( int i = 0;i < 8;i++ ){
			if( !( cin >> data[i] ) ) return 0;
		}

		int answer = 0;
		for( int i = 0;i < 8;i++ ){
			for( int j = 0;j < 8;j++ ){
				if( data[i][j] == '1' ){
					for( int k = 0;k < 7;k++ ){
						if( data[i + place[k][0].y][j + place[k][0].x] == '1' &&  data[i + place[k][1].y][j + place[k][1].x] == '1' && data[i + place[k][2].y][j + place[k][2].x] == '1' && data[i + place[k][3].y][j + place[k][3].x] == '1' ){
							answer = k;
							goto END;
						}
					}
				}
			}
		}
END:

		cout << static_cast<char>( 'A' + answer ) << endl;
	}


	return 0;
}

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){
			scanf("%c", &t);
		}
		f[0] = t;
		for(int i = 1; i < 64; i++){
			scanf("%c", &t);
			if(t == 10){
				scanf("%c", &t);
			}
			f[i] = t;
		}
		f[64] = '\0';
		printf("%s", f);
		for(int i = 0; i < 7; i++){
			if(strstr(f, p[i])){
				printf("%c\n", i + 'A');
			}
		}
	}
	return 0;
}

C++: #include <bits/stdc++.h>

using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)

char S[8][9];

bool check(int x1,int y1,int x2,int y2,int x3,int y3,int x4,int y4){
	if (S[y1][x1]=='1' && S[y2][x2]=='1' &&S[y3][x3]=='1' &&S[y4][x4]=='1'){
		return true;
	}
	return false;
}

int main(){
	while (scanf("%s",S[0])!=EOF){
		FOR(i,1,8){
			scanf("%s",S[i]);
		}
		REP(i,7){
			REP(j,7){
				if (check(i,j,i+1,j,i,j+1,i+1,j+1)){
					printf("A\n");
				}
			}
		}
		REP(i,8){
			REP(j,5){
				if (check(i,j,i,j+1,i,j+2,i,j+3)) printf("B\n");
			}
		}
		REP(i,5) REP(j,8) if (check(i,j,i+1,j,i+2,j,i+3,j)) printf("C\n");
		REP(i,7) REP(j,6) if (check(i+1,j,i,j+1,i+1,j+1,i,j+2)) printf("D\n");
		REP(i,6) REP(j,7) if (check(i,j,i+1,j,i+1,j+1,i+2,j+1)) printf("E\n");
		REP(i,7) REP(j,6) if (check(i,j,i,j+1,i+1,j+1,i+1,j+2)) printf("F\n");
		REP(i,6) REP(j,7) if (check(i+1,j,i+2,j,i,j+1,i+1,j+1)) printf("G\n");
	}
	return 0;
}

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

int ax[7] = {2, 1, 4, 2, 3, 2, 3};
int ay[7] = {2, 4, 1, 3, 2, 3, 2};
int a[7][4][4] = {
  {
    {1, 1},
    {1, 1},
  },
  {
    {1},
    {1},
    {1},
    {1},
  },
  {
    {1, 1, 1, 1},
  },
  {
    {0, 1},
    {1, 1},
    {1, 0},
  },
  {
    {1, 1, 0},
    {0, 1, 1},
  },
  {
    {1, 0},
    {1, 1},
    {0, 1},
  },
  {
    {0, 1, 1},
    {1, 1, 0},
  },
};

string p[8];
int main()
{
  char tmp;
  do
  {
    for(int i = 0; i < 8; i++)
      cin >> p[i];
    for(int i = 0; i < 7; i++)
    {
      for(int y = 0; y < 8 - ay[i] + 1; y++)
      {
        for(int x = 0; x < 8 - ax[i] + 1; x++)
        {
          for(int yy = 0; yy < ay[i]; yy++)
          {
            for(int xx = 0; xx < ax[i]; xx++)
            {
              if(p[y + yy][x + xx] - '0' != a[i][yy][xx])
                goto aaa;
            }
          }
          cout << (char)('A' + i) << endl;
          goto bbb;
aaa:;
        }
      }
    }
bbb:;
  } while(cin >> tmp);
}

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

string field[8];

bool ch(int i,int j)
{
	if(field[i][j] == '1') return true;
	return false;
}

bool Check_A(int i,int j)
{
	if(i+1 < 8 && j+1 < 8)
	{
		if(ch(i,j) && ch(i+1,j) && ch(i,j+1) && ch(i+1,j+1))  return true;
	}
	return false;
}

bool Check_B(int i,int j)
{
	if(i+1 < 8 && i+2 < 8 && i+3 < 8)
	{
		if(ch(i,j) && ch(i+1,j) && ch(i+2,j) && ch(i+3,j)) return true;
	}
	return false;
}

bool Check_C(int i,int j)
{
	if(j+1 < 8 && j+2 < 8 && j+3 < 8)
	{
		if(ch(i,j) && ch(i,j+1) && ch(i,j+2) && ch(i,j+3)) return true;
	}
	return false;
}

bool Check_D(int i,int j)
{
	if(j-1 > 0 && i+1 < 8 && i+2 < 8)
	{
		if(ch(i,j) && ch(i+1,j) && ch(i+1,j-1) && ch(i+2,j-1)) return true;
	}
	return false;
}

bool Check_E(int i,int j)
{
	if(i+1 < 8 && j+1 < 8 && j+2 < 8)
	{
		if(ch(i,j) && ch(i,j+1) && ch(i+1,j+1) && ch(i+1,j+2)) return true;
	}
	return false;
}

bool Check_F(int i,int j)
{
	if(i+1 < 8 && i+2 < 8 && i+3 < 8)
	{
		if(ch(i,j) && ch(i+1,j) && ch(i+1,j+1)&& ch(i+2,j+1)) return true;
	}
	return false;
}

bool Check_G(int i,int j)
{
	if(i+1 < 8 && j+1 < 8 && j-1 > 0)
	{
		if(ch(i,j) && ch(i+1,j) && ch(i,j+1) && ch(i+1,j-1)) return true;
	}
	return false;
}

int main()
{
	while(cin >> field[0])
	{
		for(int i=1;i<8;i++)
		{
			cin >> field[i];
		}
		
		bool flag = true;
		for(int i=0;i<8;i++)
		{
			for(int j=0;j<8;j++)
			{
				if(Check_A(i,j) && flag)
				{
					cout << "A" << endl;
					flag = false;
				}

				if(Check_B(i,j) && flag)
				{
					cout << "B" << endl;
					flag = false;
				}

				if(Check_C(i,j) && flag)
				{
					cout << "C" << endl;
					flag = false;
				}

				if(Check_D(i,j) && flag)
				{
					cout << "D" << endl;
					flag = false;
				}				

				if(Check_E(i,j) && flag)
				{
					cout << "E" << endl;
					flag = false;
				}

				if(Check_F(i,j) && flag)
				{
					cout << "F" << endl;
					flag = false;
				}

				if(Check_G(i,j) && flag)
				{
					cout << "G" << endl;
					flag = false;
				}
			}
		}
	}
	return 0;
}