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>
using namespace std;
char box[8][8];
char search(const int i,const int j){
	if(box[i][j+1]=='1' && box[i+1][j]=='1' && box[i+1][j+1]=='1') return('A'); 
	else if(box[i+1][j]=='1' && box[i+2][j]=='1' && box[i+3][j]=='1') return('B') ;
	else if(box[i][j+1]=='1' && box[i][j+2]=='1' && box[i][j+3]=='1') return('C') ;
	else if(box[i+1][j]=='1' && box[i+1][j-1]=='1' && box[i+2][j-1]=='1') return('D');
	else if(box[i][j+1]=='1' && box[i+1][j+1]=='1' && box[i+1][j+2]=='1') return('E');
	else if(box[i+1][j]=='1' && box[i+1][j+1]=='1' && box[i+2][j+1]=='1') return('F');
	else if(box[i][j+1]=='1' && box[i+1][j]=='1' && box[i+1][j-1]=='1') return('G'); 
	else return('0');
}

int main(){
	char ans='0';bool flag=false; int n=0;
	for(int i=0;i<8;i++)
		for(int j=0;j<8;j++) cin >> box[i][j] ;
	for(int i=0;i<8;i++){
		for(int j=0;j<8;j++){
			if(box[i][j]=='0') continue;
			if(ans=='0' && box[i][j]=='1') ans=search(i,j);
		};
	};
	cout << ans << '\n' ;
}

C++: #include <stdio.h>
#include <algorithm>
using namespace std;

int pow(int a,int n){
	if(n <= 0){
		return 1;
	}
	return a * pow(a,n - 1);
}

int main(){
char a[8][9];
int ans = 0;
while(1){
for(int i = 0; i < 8; i++){
if(scanf("%s",&a[i]) == EOF){
return 0;
}
}

for(int i = 0; i < 8; i++){

for(int j = 0; j < 8; j++){

if(a[i][j] == '1'){

if(i < 7 && j < 7){
if(a[i+1][j] == '1' && a[i][j+1] == '1' && a[i+1][j+1] == '1'){
printf("A\n");
}
}
if(i < 5){
if(a[i+1][j] == '1' && a[i+2][j] == '1' && a[i+3][j] == '1'){
printf("B\n");
}
}
if(j < 5){
if(a[i][j+1] == '1' && a[i][j+2] == '1' && a[i][j+3] == '1'){
printf("C\n");
}
}
if(i < 6 && j < 5){
if(a[i][j+1] == '1' && a[i+1][j+1] == '1' && a[i+1][j+2] == '1'){
printf("E\n");
}
}
if(i < 5 && j < 6){
if(a[i+1][j] == '1' && a[i+1][j+1] == '1' && a[i+2][j+1] == '1'){
printf("F\n");
}
}
if(j > 0 && i < 6){
if(a[i+1][j] == '1' && a[i+1][j-1] == '1' && a[i+2][j-1] == '1'){
printf("D\n");
}
}
if(j > 0 && j < 7 && i < 7){
if(a[i+1][j] == '1' && a[i][j+1] == '1' && a[i+1][j-1] == '1'){
printf("G\n");
}
}

}

}

}
}

	///////////////////////////////////
	//Sleep(200000);///////////////////// 提出するときは必ず外す！
	///////////////////////////////////
	return 0;

}

C++: //A Figure on Surface

#include<iostream>
#include<string>
using namespace std;

int main(void)
{
	const int N = 8;
	while(1)
	{
		string a[N];
		int i, j;
		for(i = 0; i < N; i++)
		{
			cin >> a[i];
		}
		if(!cin)
			break;

		//¶ã©çÌÀWð²×é
		for(i = 0; i < N; i++)
		{
			for(j = 0; j < N; j++)
			{
				if(a[i][j] == '1')
					goto DISCOVER;
			}
		}
		DISCOVER:
		//ÔÈñÄÇ¤ÅàÇ¢©çÀSÉs«Üµå¤
		if( (i < N-1) && (j < N-1) && 
			(a[i][j] == a[i+1][j]) &&
			(a[i][j] == a[i][j+1]) &&
			(a[i][j] == a[i+1][j+1]) )
			cout << 'A' << endl;
		else if((i < N-3) && 
			(a[i][j] == a[i+3][j]) )
			cout << 'B' << endl;
		else if((j < N-3) &&
			(a[i][j] == a[i][j+3]) )
			cout << 'C' << endl;
		else if((i < N-2) && (j > 0 ) &&
			(a[i][j] == a[i+2][j-1]) )
			cout << 'D' << endl;
		else if((j < N-2) &&
			(a[i][j] == a[i+1][j+2]) )
			cout << 'E' << endl;
		else if((i < N-2) &&
			(a[i][j] == a[i+2][j+1]) )
			cout << 'F' << endl;
		else
			cout << 'G' << endl;
	}
	return 0;
}

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(i+k<0||i+k>7||j+l<0||j+k>7){
	      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;
}

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];
		}

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

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