Buggy python submission (verdict: Runtime Error):
def gen_switch(i, n):
    ret = []
    str_bin = format(i, '011b')
    for k in range(n):
        ret.append(int(str_bin[-k-1]))
    ret.reverse()
    return ret


input_line = raw_input()
splitted_line = input_line.split(" ")
n = int(splitted_line[0])
m = int(splitted_line[1])


my_mtx = []

for i in range(m):
    my_list = [0] * n
    splitted_line = raw_input().split(" ")

    for j in range(len(splitted_line)):
        if j != 0:
            my_list[int(splitted_line[j])-1] = 1

    my_mtx.append(my_list)

splitted_line = raw_input().split(" ")
my_list = []

for item in splitted_line:
    my_list.append(int(item))


count = 0

# print(my_list)

for i in range(2 ** n):
    my_switch = gen_switch(i, n)
    for j in range(m):
        my_sum = 0
        for k in range(len(my_switch)):
            my_sum = my_sum + (my_switch[k] * my_mtx[j][k])
        if my_sum % 2 != my_list[j]:
            break
        if j == m - 1:
            count = count + 1

print(count)


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(raw_input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(raw_input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted_1 = sorted(my_set)
 
for item in my_sorted_1:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])

Buggy python submission (verdict: Runtime Error):
number = int(input())
my_set = set()
for i in range(number):
    input_line = raw_input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])


Fixed submission:
number = int(input())
my_set = set()
for i in range(number):
    input_line = input()
    splitted_line = input_line.split(" ")
    my_set.add((splitted_line[0], - int(splitted_line[1]), i+1))

my_sorted = sorted(my_set)

for item in my_sorted:
    print(item[2])