Buggy python submission (verdict: Runtime Error):
def university(xxx, pattern):
    tate = 0
    yoko = 1
    for current_tate in range(8-xxx[tate]+1):
        for current_yoko in range(8-xxx[yoko]+1):
            if absolutely_fantastic(current_tate, current_yoko):
                return True

def absolutely_fantastic(current_tate, current_yoko):
    tate = 0
    yoko = 1
    run = []
    for add_tate in range(xxx[tate]):
        for add_yoko in range(xxx[yoko]):
            run.append(mapppp[current_tate+add_tate][current_yoko+add_yoko])
    if run == pattern:
        print xxx[2]
        return True

A = {(2,2,'A'):[1,1,1,1]}
B = {(4,1,'B'):[1,1,1,1]}
C = {(1,4,'C'):[1,1,1,1]}
D = {(3,2,'D'):[0,1,1,1,1,0]}
E = {(2,3,'E'):[1,1,0,0,1,1]}
F = {(3,2,'F'):[1,0,1,1,0,1]}
G = {(2,3,'G'):[0,1,1,1,1,0]}
lis = [A,B,C,D,E,F,G]
mapppp = []
while True:
    input_line = raw_input()
    if input_line:
        yoko = [int(char) for char in input_line]
        mapppp.append(yoko)
    else:
        for XXX in lis:
            flag = False
            for xxx, pattern in XXX.items():
                if university(xxx, pattern):
                    flag = True
                    break
            if flag == True:
                break

Fixed submission:
# -*- coding: utf-8 -*-
figures = {
    'A': [['1', '1'], ['1', '1']],
    'B': [['1'], ['1'], ['1'], ['1']],
    'C': [['1', '1', '1', '1']],
    'D': [['0', '1'], ['1', '1'], ['1', '0']],
    'E': [['1', '1', '0'], ['0', '1', '1']],
    'F': [['1', '0'], ['1', '1'], ['0', '1']],
    'G': [['0', '1', '1'], ['1', '1', '0']],
}


def f1(lines):
    for n, figure in figures.items():
        found = f2(lines, figure)
        if found:
            print(n)
            break


def f2(lines, figure):
    height = len(figure)
    width = len(figure[0])
    for h in range(8 - height + 1):
        for w in range(8 - width + 1):
            found = f3(lines, figure, height, width, h, w)
            if found:
                return True


def f3(lines, figure, height, width, h, w):
    _figure = [[lines[h+_h][w+_w] for _w in range(width)]
               for _h in range(height)]
    if figure == _figure:
        return True


try:
    while True:
        f1([list(input()) for _ in range(8)])
        input()
except EOFError:
    pass

Buggy python submission (verdict: Runtime Error):
def university(xxx, pattern):
    tate = 0
    yoko = 1
    for current_tate in range(8-xxx[tate]+1):
        for current_yoko in range(8-xxx[yoko]+1):
            if absolutely_fantastic(current_tate, current_yoko):
                return True

def absolutely_fantastic(current_tate, current_yoko):
    tate = 0
    yoko = 1
    run = []
    for add_tate in range(xxx[tate]):
        for add_yoko in range(xxx[yoko]):
            run.append(mapppp[current_tate+add_tate][current_yoko+add_yoko])
    if run == pattern:
        print xxx[2]
        return True

A = {(2,2,'A'):[1,1,1,1]}
B = {(4,1,'B'):[1,1,1,1]}
C = {(1,4,'C'):[1,1,1,1]}
D = {(3,2,'D'):[0,1,1,1,1,0]}
E = {(2,3,'E'):[1,1,0,0,1,1]}
F = {(3,2,'F'):[1,0,1,1,0,1]}
G = {(2,3,'G'):[0,1,1,1,1,0]}
lis = [A,B,C,D,E,F,G]
mapppp = []
while True:
    for i in range(8):
        input_line = raw_input()
        yoko = [int(char) for char in input_line]
        mapppp.append(yoko)
    for XXX in lis:
        flag = False
        for xxx, pattern in XXX.items():
            if university(xxx, pattern):
                flag = True
                break
        if flag == True:
            break
    raw_input()

Fixed submission:
# -*- coding: utf-8 -*-
figures = {
    'A': [['1', '1'], ['1', '1']],
    'B': [['1'], ['1'], ['1'], ['1']],
    'C': [['1', '1', '1', '1']],
    'D': [['0', '1'], ['1', '1'], ['1', '0']],
    'E': [['1', '1', '0'], ['0', '1', '1']],
    'F': [['1', '0'], ['1', '1'], ['0', '1']],
    'G': [['0', '1', '1'], ['1', '1', '0']],
}


def f1(lines):
    for n, figure in figures.items():
        found = f2(lines, figure)
        if found:
            print(n)
            break


def f2(lines, figure):
    height = len(figure)
    width = len(figure[0])
    for h in range(8 - height + 1):
        for w in range(8 - width + 1):
            found = f3(lines, figure, height, width, h, w)
            if found:
                return True


def f3(lines, figure, height, width, h, w):
    _figure = [[lines[h+_h][w+_w] for _w in range(width)]
               for _h in range(height)]
    if figure == _figure:
        return True


try:
    while True:
        f1([list(input()) for _ in range(8)])
        input()
except EOFError:
    pass

Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
figures = {
    'A': [['1', '1'], ['1', '1']],
    'B': [['1'], ['1'], ['1'], ['1']],
    'C': [['1', '1', '1', '1']],
    'D': [['0', '1'], ['1', '1'], ['1', '0']],
    'E': [['1', '1', '0'], ['0', '1', '1']],
    'F': [['1', '0'], ['1', '1'], ['0', '1']],
    'G': [['0', '1', '1'], ['1', '1', '0']],
}


def f1(lines):
    for n, figure in figures.items():
        found = f2(lines, figure)
        if found:
            print(n)
            break


def f2(lines, figure):
    height = len(figure)
    width = len(figure[0])
    for h in range(8 - height + 1):
        for w in range(8 - width + 1):
            found = f3(lines, figure, height, width, h, w)
            if found:
                return True


def f3(lines, figure, height, width, h, w):
    _figure = [[lines[h+_h][w+_w] for _w in range(width)]
               for _h in range(height)]
    if figure == _figure:
        return True


try:
    while True:
        f1([list(input()) for _ in range(8)])
except EOFError:
    pass

Fixed submission:
# -*- coding: utf-8 -*-
figures = {
    'A': [['1', '1'], ['1', '1']],
    'B': [['1'], ['1'], ['1'], ['1']],
    'C': [['1', '1', '1', '1']],
    'D': [['0', '1'], ['1', '1'], ['1', '0']],
    'E': [['1', '1', '0'], ['0', '1', '1']],
    'F': [['1', '0'], ['1', '1'], ['0', '1']],
    'G': [['0', '1', '1'], ['1', '1', '0']],
}


def f1(lines):
    for n, figure in figures.items():
        found = f2(lines, figure)
        if found:
            print(n)
            break


def f2(lines, figure):
    height = len(figure)
    width = len(figure[0])
    for h in range(8 - height + 1):
        for w in range(8 - width + 1):
            found = f3(lines, figure, height, width, h, w)
            if found:
                return True


def f3(lines, figure, height, width, h, w):
    _figure = [[lines[h+_h][w+_w] for _w in range(width)]
               for _h in range(height)]
    if figure == _figure:
        return True


try:
    while True:
        f1([list(input()) for _ in range(8)])
        input()
except EOFError:
    pass