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;

int main(int argc, char *argv[]) {
  int sur[8][8];
  int x, y;
  string s;

  while (true) {
    bool isGetted = false;
    for (int i = 0; i < 8; i++) {
      getline(cin, s);
      for (int j = 0; j < 8; j++) {
        if (s[j] == '1' && !isGetted) {
          x = j;
          y = i;
          isGetted = true;
        }
        sur[i][j] = s[j] - '0';
      }
    }

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

    if (!getline(cin, s))
      break;
  }
  return 0;
}

C++: #include <iostream>
#include <array>

using namespace std;

char checkData( array< int, 4 > data_i, array< int, 4 > data_j )
{
        int i = 0, j = 0;
        if (
                        data_i[i] + 1 == data_i[i+1] &&
                        data_j[j] == data_j[j+1] &&
                        data_i[i] == data_i[i+2] &&
                        data_j[j] + 1 == data_j[i+2] &&
                        data_i[i] + 1 == data_i[j+3] &&
                        data_j[j] + 1 == data_j[j+3]
           )
        {
                return 'A';
        }
        else if (
                        data_i[i] == data_i[i+1] &&
                        data_j[j] + 1 == data_j[j+1] &&
                        data_i[i] == data_i[i+2] &&
                        data_j[j] + 2 == data_j[j+2] &&
                        data_i[i] == data_i[i+3] &&
                        data_j[j] + 3 == data_j[j+3]
        )
        {
                return 'B';
        }
        else if (
                        data_i[i] + 1 == data_i[i+1] &&
                        data_j[j] == data_j[j+1] &&
                        data_i[i] + 2 == data_i[i+2] &&
                        data_j[j] == data_j[j+2] &&
                        data_i[i] + 3 == data_i[j+3] &&
                        data_j[j] == data_j[j+3]
        )
        {
                return 'C';
        }
        else if (
                        data_i[i] - 1 == data_i[i+1] &&
                        data_j[j] + 1 == data_j[j+1] &&
                        data_i[i] == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] - 1 == data_i[i+3] &&
                        data_j[j] + 2 == data_j[j+3]
        )
        {
                return 'D';
        }
        else if (
                        data_i[i] + 1 == data_i[i+1] &&
                        data_j[j] == data_j[j+1] &&
                        data_i[i] + 1 == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] + 2 == data_i[i+3] &&
                        data_j[j] + 1 == data_j[j+3]
        )
        {
                return 'E';
        }
        else if (
                        data_i[i] == data_i[i+1] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] + 1 == data_i[i+2] &&
                        data_j[j] + 1 == data_j[j+2] &&
                        data_i[i] + 1 == data_i[i+2] &&
                        data_j[j] + 2 == data_j[j+3]
        )
        {
                return 'F';
        }
        else
        {
                return 'G';
        }


}


int main()
{
        char table[8][8];
        array< int, 4 > data_i;
        array< int, 4 > data_j;
        int tmp = 0, inum = 0, jnum = 0, i, j;

        while ( cin >> table[0] )
        {
                for ( i = 1 ; i < 8 ; i++ )
                {
                        cin >> table[i];
                }
                for ( i = 0 ; i < 8 ; i++ )
                {
                        for ( j = 0 ; j < 8 ; j++ )
                        {
                                if ( table[i][j] == '1' )
                                {
                                        data_i[inum] = i;
                                        data_j[jnum] = j;
                                        inum++;
                                        jnum++;
                                }
                        }
                }
                inum = 0;
                jnum = 0;
                cout << checkData( data_j, data_i ) << endl;
        }
        return 0;
}