Buggy python submission (verdict: Runtime Error):
def OorC():
    if (T in lst) == True:
        if lst2[lst.index(T)] % 2 == 0:
            lst2[lst.index(T)] += 1
            print "Opened by " + T
        else:
            lst2[lst.index(T)] += 1
            print "Closed by " + T
    else:
        print "Unknown " + T
        

while 1:
    N = int(input())
    if N == 0:
        break
    lst = []
    lst2 = []
    for i in range(N):
        lst.append(str(raw_input()))
        lst2.append(0)
    M = int(input())
    for j in range(M):
        T = str(raw_input())
        OorC()
        

Fixed submission:
N = int(input())
a = 0
lst = []
for i in range(N):
    lst.append(str(raw_input()))
M = int(input())
for j in range(M):
    T = str(raw_input())
    if (T in lst) == True:
        if a == 0:
            a = 1
            print "Opened by " + T
        else:
            a = 0
            print "Closed by " + T
    else:
        print "Unknown " + T

Buggy python submission (verdict: Runtime Error):
def OorC():
    if (T in lst) == True:
        if lst2[lst.index(T)] % 2 == 0:
            lst2[lst.index(T)] += 1
            print "Opened by " + T
        else:
            lst2[lst.index(T)] += 1
            print "Closed by " + T
    else:
        print "Unknown " + T
        

while 1:
    N = int(input())
    lst = []
    lst2 = []
    for i in range(N):
        lst.append(str(raw_input()))
        lst2.append(0)
    M = int(input())
    for j in range(M):
        T = str(raw_input())
        OorC()

Fixed submission:
N = int(input())
a = 0
lst = []
for i in range(N):
    lst.append(str(raw_input()))
M = int(input())
for j in range(M):
    T = str(raw_input())
    if (T in lst) == True:
        if a == 0:
            a = 1
            print "Opened by " + T
        else:
            a = 0
            print "Closed by " + T
    else:
        print "Unknown " + T

Buggy python submission (verdict: Runtime Error):
while 1:
    N = int(input())
    a = 0
    lst = []
    for i in range(N):
        lst.append(str(raw_input()))
    M = int(input())
    for j in range(M):
        T = str(raw_input())
        if (T in lst) == True:
            if a == 0:
                a = 1
                print "Opened by " + T
            else:
                a = 0
                print "Closed by " + T
        else:
            print "Unknown " + T
        

Fixed submission:
N = int(input())
a = 0
lst = []
for i in range(N):
    lst.append(str(raw_input()))
M = int(input())
for j in range(M):
    T = str(raw_input())
    if (T in lst) == True:
        if a == 0:
            a = 1
            print "Opened by " + T
        else:
            a = 0
            print "Closed by " + T
    else:
        print "Unknown " + T

Buggy python submission (verdict: Runtime Error):
while 1:
    N = int(input())
    a = 0
    lst = []
    for i in range(N):
        lst.append(str(raw_input()))
    M = int(input())
    for j in range(M):
        T = str(raw_input())
        if (T in lst) == True:
            if a == 0:
                a = 1
                print "Opened by " + T
            else:
                a = 0
                print "Closed by " + T
        else:
            print "Unknown " + T
        

Fixed submission:
N = int(input())
a = 0
lst = []
for i in range(N):
    lst.append(str(raw_input()))
M = int(input())
for j in range(M):
    T = str(raw_input())
    if (T in lst) == True:
        if a == 0:
            a = 1
            print "Opened by " + T
        else:
            a = 0
            print "Closed by " + T
    else:
        print "Unknown " + T

Buggy python submission (verdict: Runtime Error):

    N = int(input())
    a = 0
    lst = []
    for i in range(N):
        lst.append(str(raw_input()))
    M = int(input())
    for j in range(M):
        T = str(raw_input())
        if (T in lst) == True:
            if a == 0:
                a = 1
                print "Opened by " + T
            else:
                a = 0
                print "Closed by " + T
        else:
            print "Unknown " + T

Fixed submission:
N = int(input())
a = 0
lst = []
for i in range(N):
    lst.append(str(raw_input()))
M = int(input())
for j in range(M):
    T = str(raw_input())
    if (T in lst) == True:
        if a == 0:
            a = 1
            print "Opened by " + T
        else:
            a = 0
            print "Closed by " + T
    else:
        print "Unknown " + T