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
}

var emptyBoard = [][]int{{0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
						 {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0},
	                     {0,0,0,0,0,0,0,0}}

func main() {
	for {
		var board [][]int
		var ans string
		if board = scanBoard(); reflect.DeepEqual(board, emptyBoard) {
			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)
		fmt.Scanln()
	}
}

C++: #include<stdio.h>

int main(){
	char masu[15][15];
	int i,j;
	
	while(scanf("%c", &masu[0][0]) != EOF){
		for(i=1;i<9;i++)scanf("%c", &masu[0][i]);
		
		for(i=1;i<8;i++){
			for(j=0;j<9;j++){
				scanf("%c", &masu[i][j]);
			}
		}
		scanf("%c", &masu[15][15]);
		for(i=0;i<8;i++){
			for(j=0;j<8;j++){
				if(masu[i][j]=='1'   && masu[i+1][j]=='1' && masu[i][j+1]=='1'   && masu[i+1][j+1]=='1')puts("A");
				if(masu[i][j]=='1'   && masu[i+1][j]=='1' && masu[i+2][j]=='1'   && masu[i+3][j]=='1')  puts("B");
				if(masu[i][j]=='1'   && masu[i][j+1]=='1' && masu[i][j+2]=='1'   && masu[i][j+3]=='1')  puts("C");
				if(masu[i][j+1]=='1' && masu[i+1][j]=='1' && masu[i+2][j]=='1'   && masu[i+1][j+1]=='1')puts("D");
				if(masu[i][j]=='1'   && masu[i][j+1]=='1' && masu[i+1][j+1]=='1' && masu[i+1][j+2]=='1')puts("E");
				if(masu[i][j]=='1'   && masu[i+1][j]=='1' && masu[i+1][j+1]=='1' && masu[i+2][j+1]=='1')puts("F");
				if(masu[i][j+1]=='1' && masu[i+1][j]=='1' && masu[i][j+2]=='1'   && masu[i+1][j+1]=='1')puts("G");
			}
		}
	}
	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[16][16], x = SIZE, y = SIZE;
		for (int i = 0; i < SIZE; i++) {
			for (int j = 0; j < SIZE; j++) {
				map[i + 4][j + 4] = source[i][j] == '1' ? 1 : 0;
				if (source[i][j] == '1' && j < x && i < y) {
					x = j;
					y = i;
				}
			}
		}
		x += 4;
		y += 4;

		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) {
				cout << "F";
			} else if (map[y + 1][x + 2] == 1) {
				cout << "E";
			}
		} else if (map[y - 1][x - 1] == 1) {
			if (map[y][x + 1] == 1) {
				cout << "G";
			} else if (map[y + 2][x - 1] == 1) {
				cout << "D";
			}
		} else if (map[y + 3][x]) {
			cout << "B";
		} else {
			cout << "C";
		}
		cout << endl;
	}
	return 0;
}

C++: #include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
#define rep2(x,from,to) for(int x = (from); x < (to); ++(x))
#define rep(x,to) rep2(x,0,to) 

int main() {
	int t[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}}};
	string str;
	while(cin >> str) {
		vector<string> s(8);
		s[0] = str;
		int board[11][11];
		rep2(i,1,8) {
			cin >> s[i];
		}
		
		rep(i,8) {
			rep(j,8) {
				board[i][j] = s[i][j] - '0';
			}
		}
		rep2(i,8,11) {
			rep2(j,8,11) {
				board[i][j] = 0;
			}
		}
		rep(i,64) {
			bool f = 1;
			rep(k,7) {
				f = 1;
				rep(l,16) {
					if(board[i / 8 + l / 4][i % 8 + l % 4] != t[k][l / 4][l % 4]) {
						f = 0;
						break;
					}
				}
				if(f) {
					cout << (char) (k + 'A') << endl;
					break;
				}
			}
			if(f) break;
		}
	}
	return 0;
}

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

int main() {
  char x;
  int k=0;
  while(cin.get(x)) {
    if(x == 1) {
      k = k % 7;
      break;
    }
    k++;
  }
  cin.get(x);
  if(x == 1) {// A,C,E,G
    cin.get(x);
    if(x == 1) // C
      cout << "C" << endl;
    else if(x == 0) {//A,E,G
      for(int i=0;i<6;i++){
        cin.get(x);
      }
      if(x == 1)
        cout << "G" << endl; // G
      else if(x == 0) {
        cin.get(x);
        if(x == 1)
          cout << "A" << endl; // A
        else
          cout << "E" << endl; // E
      }
    }
  }
  else if(x == 0) {//B,D,F
    for(int i=0;i<6;i++) {
      cin.get(x);
    }
    if(x == 1)
      cout << "D" << endl;
    else if(x == 0) {
      cin.get(x);
      cin.get(x);
      if(x == 1)
        cout << "F" << endl;
      else
        cout << "B" << endl;
    }
  }
}