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)
	}
}

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

class Point{
public:
  int x, y;
  Point(int x = 0, int y = 0) : x(x), y(y) {}
};

int main() {
  static Point blocks[7][4];
  blocks[0][0] = Point(0, 0);
  blocks[0][1] = Point(1, 0);
  blocks[0][2] = Point(0, 1);
  blocks[0][3] = Point(1, 1);
  blocks[1][0] = Point(0, 0);
  blocks[1][1] = Point(0, 1);
  blocks[1][2] = Point(0, 2);
  blocks[1][3] = Point(0, 3);
  blocks[2][0] = Point(0, 0);
  blocks[2][1] = Point(1, 0);
  blocks[2][2] = Point(2, 0);
  blocks[2][3] = Point(3, 0);
  blocks[3][0] = Point(1, 0);
  blocks[3][1] = Point(0, 1);
  blocks[3][2] = Point(1, 1);
  blocks[3][3] = Point(0, 2);
  blocks[4][0] = Point(0, 0);
  blocks[4][1] = Point(1, 0);
  blocks[4][2] = Point(1, 1);
  blocks[4][3] = Point(2, 1);
  blocks[5][0] = Point(0, 0);
  blocks[5][1] = Point(0, 1);
  blocks[5][2] = Point(1, 1);
  blocks[5][3] = Point(1, 2);
  blocks[6][0] = Point(1, 0);
  blocks[6][1] = Point(2, 0);
  blocks[6][2] = Point(0, 1);
  blocks[6][3] = Point(1, 1);

  string data[8];
  while(getline(cin, data[0])) {
    for(int i = 1; i < 8; i++) {
      getline(cin, data[i]);
    }
    getchar();
    for(int i = 0; i < 8; i++) {
      for(int j = 0; j < 8; j++) {
	if(data[i][j] == '1') {
	  for(int n = 0; n < 7; n++) {
	    bool flag = true;
	    int ox = j - blocks[n][0].x;
	    int oy = i - blocks[n][0].y;
	    for(int p = 1; p < 4; p++) {
	      int nx = ox+blocks[n][p].x;
	      int ny = oy+blocks[n][p].y;
	      if(nx < 0 || nx >= 8 || ny < 0 || ny >= 8) {
		flag = false;
		break;
	      }

	      if(data[ny][nx] != '1') {
	        flag = false;
	        break;
	      }
	    }
	    if(flag) {
	      cout << (char)((int)'A'+n) << endl;
	      break;
	    }
	  }
	  i = 8;
	  break;
        }
      }
    }
  }
  return 0;
}

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

string s[10];

int main() {
	while(1){
		int t = 0;
		int r = 0;
		for (int i = 0; i < 9; i++) {
			if (!(cin >> s[i]))return 0;
		}
		for (int i = 0; i < 9; i++) {
			for (int j = 0; j < 9; j++)
			{
				if (s[i][j] == '1') {
					if (t == 0)t = 8 * i + j;
					r += 8 * i + j;
				}
			}
		}
		r -= 4 * t;
		if (r == 19)cout << 'A' << endl;
		else if (r == 48)cout << 'B' << endl;
		else if (r == 6)cout << 'C' << endl;
		else if (r == 30)cout << 'D' << endl;
		else if (r == 20)cout << 'E' << endl;
		else if (r == 34)cout << 'F' << endl;
		else if (r == 16)cout << 'G' << endl; }
}

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

char data[8][8];
int px, py;

int main(){
	while (true){
		for(int i = 0; i < 8 ; i++){
			for(int j = 0; j < 8; j++){
				if(!(std::cin >> data[i][j]))goto end;
				if(data[i][j] == '1')px = j, py = i;
			}
		}

		if (data[py][px - 1] == '1' && data[py - 1][px] == '1' && data[py - 1][px - 1] == '1')printf("A\n");
		else if (data[py - 1][px] == '1' && data[py - 2][px] == '1' && data[py - 3][px] == '1')printf("B\n");
		else if (data[py][px - 1] == '1' && data[py][px - 2] == '1' && data[py][px - 3] == '1')printf("C\n");
		else if (data[py][px - 1] == '1' && data[py + 1][px - 1] == '1' && data[py - 1][px] == '1')printf("D\n");
		else if (data[py][px - 1] == '1' && data[py - 1][px - 1] == '1' && data[py - 1][px - 2] == '1')printf("E\n");
		else if (data[py][px - 1] == '1' && data[py - 1][px - 1] == '1' && data[py + 1][px] == '1')printf("F\n");
		else if (data[py - 1][px] == '1' && data[py - 1][px + 1] == '1' && data[py][px - 1] == '1')printf("G\n");
	}
	end:;
	return 0;
}

C++: #include <iostream>
#include <vector>
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;
}