Buggy python submission (verdict: Runtime Error):
# -*- coding: utf8 -*-

import sys


types = ['A', 'B', 'C', 'D', 'E', 'F', 'G']


def main():
    while True:
        try:
            data = []
            for i in xrange(8):
                data.append(raw_input())

            check_figure(data)

            # 空行
            raw_input()
        except EOFError:
            break


def check_figure(data):
    # 最初の1を探す
    for i in xrange(8):
        for j in xrange(8):
            if data[i][j] == "1":
                for t in types:
                    if check_pattern(data, pattern(t, i, j)):
                        print t
                        return
                return


def pattern(p, i, j):
    if p == 'A':
        return [(i, j), (i, j + 1), (i + 1,  j), (i + 1, j + 1)]
    elif p == 'B':
        return [(i, j), (i + 1, j), (i + 2, j), (i + 3, j)]
    elif p == 'C':
        return [(i, j), (i, j + 1), (i, j + 2), (i, j + 3)]
    elif p == 'D':
        return [(i, j), (i + 1, j - 1), (i + 1, j), (i + 2, j - 1)]
    elif p == 'E':
        return [(i, j), (i, j + 1), (i + 1, j + 1), (i + 1, j + 2)]
    elif p == 'F':
        return [(i, j), (i + 1, j), (i + 1, j + 1), (i + 2, j + 1)]
    elif p == 'G':
        return [(i, j), (i, j + 1), (i + 1, j - 1), (i + 1, j)]
    else:
        return None


def check_pattern(data, block):
    for p in block:
        oob = is_out_of_bounds(p[0], p[1])
        empty = (data[p[0]][p[1]] == '0')

        if oob or empty:
            return False

    return True


def is_out_of_bounds(x, y):
    if x < 0 or x >= 8 or y < 0 or y >= 8:
        return True
    else:
        return False


main()

Fixed submission:
# -*- coding: utf8 -*-

import sys


types = ['A', 'B', 'C', 'D', 'E', 'F', 'G']


def main():
    while True:
        try:
            data = []
            for i in xrange(8):
                data.append(raw_input())

            check_figure(data)

            # 空行
            raw_input()
        except EOFError:
            break


def check_figure(data):
    # 最初の1を探す
    for i in xrange(8):
        for j in xrange(8):
            if data[i][j] == "1":
                for t in types:
                    if check_pattern(data, pattern(t, i, j)):
                        print t
                        return
                return


def pattern(p, i, j):
    if p == 'A':
        return [(i, j), (i, j + 1), (i + 1,  j), (i + 1, j + 1)]
    elif p == 'B':
        return [(i, j), (i + 1, j), (i + 2, j), (i + 3, j)]
    elif p == 'C':
        return [(i, j), (i, j + 1), (i, j + 2), (i, j + 3)]
    elif p == 'D':
        return [(i, j), (i + 1, j - 1), (i + 1, j), (i + 2, j - 1)]
    elif p == 'E':
        return [(i, j), (i, j + 1), (i + 1, j + 1), (i + 1, j + 2)]
    elif p == 'F':
        return [(i, j), (i + 1, j), (i + 1, j + 1), (i + 2, j + 1)]
    elif p == 'G':
        return [(i, j), (i, j + 1), (i + 1, j - 1), (i + 1, j)]
    else:
        return None


def check_pattern(data, block):
    for p in block:
        if is_out_of_bounds(p[0], p[1]) or (data[p[0]][p[1]] == '0'):
            return False

    return True


def is_out_of_bounds(x, y):
    if x < 0 or x >= 8 or y < 0 or y >= 8:
        return True
    else:
        return False


main()