Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8

x = input()
a = input().split()
a = a[::-1]
for i range(len(a)):
   b += a[i]+" "
print(b[-1])



Fixed submission:
# -*- coding: utf-8

x = input()
a = input().split()
a = a[::-1]
b = ""
for i in range(len(a)):
   b += a[i]+" "
print(b[:-1])

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

x = input()
a = input().split()
a = a[::-1]
for i range(len(a)):
   b += a[i]+" "
print(b[:-1])



Fixed submission:
# -*- coding: utf-8

x = input()
a = input().split()
a = a[::-1]
b = ""
for i in range(len(a)):
   b += a[i]+" "
print(b[:-1])

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

x = input()
a = input().split()
a = a[::-1]
for i in range(len(a)):
   b += a[i]+" "
print(b[:-1])



Fixed submission:
# -*- coding: utf-8

x = input()
a = input().split()
a = a[::-1]
b = ""
for i in range(len(a)):
   b += a[i]+" "
print(b[:-1])
Buggy python submission (verdict: Runtime Error):
while 1:

x,op,y = raw_input().split()

if op == "?":
    break

x = int(x)
y = int(y)

if op == "+":
    print x+y
elif op == "-":
    print x-y
elif op == "*":
    print x*y
else:
    print x/y

Fixed submission:
while 1:

    x,op,y = raw_input().split()

    if op == "?":
        break

    x = int(x)
    y = int(y)

    if op == "+":
        print x+y
    elif op == "-":
        print x-y
    elif op == "*":
        print x*y
    else:
        print x/y
Buggy python submission (verdict: Runtime Error):
mport sys

while 1:
    H,W = map(int, raw_input().split())

    if H == 0 and W == 0:
        break

    for i in range(H):
        for j in range(W):

            if i%2 == 0:
                if j%2 == 0:
                    sys.stdout.write("#")
                else:
                    sys.stdout.write(".")

                if j == W-1:
                    print ""

            if i%2 != 0:
                if j%2 != 0:
                    sys.stdout.write("#")
                else:
                    sys.stdout.write(".")

                if j == W-1:
                    print ""

        if i == H-1:
            print ""

Fixed submission:
import sys

while 1:
    H,W = map(int, raw_input().split())

    if H == 0 and W == 0:
        break

    for i in range(H):
        for j in range(W):

            if i%2 == 0:
                if j%2 == 0:
                    sys.stdout.write("#")
                else:
                    sys.stdout.write(".")

            if i%2 != 0:
                if j%2 != 0:
                    sys.stdout.write("#")
                else:
                    sys.stdout.write(".")

            if j == W-1:
                print ""

    print ""
Buggy python submission (verdict: Runtime Error):
print(x*x*x)

Fixed submission:
x=int(input())
print(x**3)

Buggy python submission (verdict: Runtime Error):
print(x*x*x)

Fixed submission:
x=int(input())
print(x**3)

Buggy python submission (verdict: Runtime Error):
x???x???x

Fixed submission:
x=int(input())
print(x**3)

Buggy python submission (verdict: Runtime Error):
x???x???x

Fixed submission:
x=int(input())
print(x**3)

Buggy python submission (verdict: Runtime Error):
if ('1<=x<=100'):
    print (x*x*x)

Fixed submission:
x=int(input())
print(x**3)

Buggy python submission (verdict: Runtime Error):
x**3

Fixed submission:
x=int(input())
print(x**3)
Buggy python submission (verdict: Runtime Error):
(a,b)=(int(),int())
x=a*b
y=(a+b)*2
print(x y)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int input().split())
print(a*b (a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b (a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(a*b (a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input())
print(a*b (a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split(''))
print(a*b 2*a+2*b)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
(a,b)=map(int,input().split(''))
print(a*b 2*a+2*b)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())

if a<b :
    print('a<b')
elif a>b :
    print('a>b')
else a=b :
    print('a==b')
    

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=int(input())
print(a*b,(a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())
print(a*b,(a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
h=[a,b]
map(int(input(),h))
print(a*b,(a+b)*2)
  

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split)
print(a*b,(a+b)*2)

Fixed submission:
a,b=map(int,input().split())
print(a*b,(a+b)*2)
Buggy python submission (verdict: Runtime Error):
h=S/3600
k=S%3600
m=k/60
s=k%60
print("%d:%d:%d" %(h,m,s))

Fixed submission:
S=int(input())
h=S/3600
k=S%3600
m=k/60
s=k%60
print("%d:%d:%d" %(h,m,s))
Buggy python submission (verdict: Runtime Error):
x,y=map(int, input().split())
a=int(x*y)
print(a)

Fixed submission:
x,y=map(int, input().split())
a = int(x * y)
b=int(2*x+2*y)

#print(x,y)
print(a,b)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input(),split())

if a < b:
    print("a<b")
else:
    if a == b:
        print("a=b")
    else:
        if a>b:
            print("a>b")

Fixed submission:
a,b=map(int, input().split())

if a < b:
    print("a < b")
else:
    if a ==b:
         print("a == b")
    else:
        if a>b:
            print( "a > b" )
Buggy python submission (verdict: Runtime Error):
x = input()
y = input()

print x * y, (x + y) * 2

Fixed submission:
x = map(int, raw_input().split())

print x[0] * x[1], (x[0] + x[1]) * 2
Buggy python submission (verdict: Runtime Error):
x = input()
out = x**3
print(out)

Fixed submission:
print((int(input()))**3)
Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = list(map(int,input().split()))
    if (r<=x<=W-r)&(r<=y<=H-y):
        print('Yes')
    else:
        print('No')

Fixed submission:
W,H,x,y,r = list(map(int,input().split()))
if (r<=x<=W-r)&(r<=y<=H-r):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = list(map(int,input().split()))
    if (r<=x<=W-r)&(r<=y<=H-y):
        print('Yes')
    else:
        print('No')

Fixed submission:
W,H,x,y,r = list(map(int,input().split()))
if (r<=x<=W-r)&(r<=y<=H-r):
    print('Yes')
else:
    print('No')

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r = list(map(int,input().split())
if (r<=x<=W-r)&(r<=y<=H-y):
    print('Yes')
else:
    print('No')

Fixed submission:
W,H,x,y,r = list(map(int,input().split()))
if (r<=x<=W-r)&(r<=y<=H-r):
    print('Yes')
else:
    print('No')
Buggy python submission (verdict: Runtime Error):
pi = 3.14159265368979
r = int(input())
print('{} {}'.fomrat(2*pi*r,pi*r*r))

Fixed submission:
import math
r = float(input())
print('{} {}'.format(math.pi*r*r,2*math.pi*r))

Buggy python submission (verdict: Runtime Error):
pi = 3.14159265368979
r = int(input())
print('{} {}'.format(2*pi*r,pi*r*r))

Fixed submission:
import math
r = float(input())
print('{} {}'.format(math.pi*r*r,2*math.pi*r))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [input().split() for i in range(N)]
Set = {}
n = list(range(1,14))
Set['S'] = n.copy()
Set['H'] = n.copy()
Set['C'] = n.copy()
Set['D'] = n.copy()

for suit,num in a:
    Set[suit].remove(num)

for i in Set['S']:
    print("S {}".format(i))
for i in Set['H']:
    print("H {}".format(i))
for i in Set['C']:
    print("C {}".format(i))
for i in Set['D']:
    print("D {}".format(i))

Fixed submission:
N = int(input())
a = [input().split() for i in range(N)]
Set = {}
n = list(range(1,14))
Set['S'] = n.copy()
Set['H'] = n.copy()
Set['C'] = n.copy()
Set['D'] = n.copy()

for suit,num in a:
    Set[suit].remove(int(num))

for i in Set['S']:
    print("S {}".format(i))
for i in Set['H']:
    print("H {}".format(i))
for i in Set['C']:
    print("C {}".format(i))
for i in Set['D']:
    print("D {}".format(i))
Buggy python submission (verdict: Runtime Error):
num = sys.stdin.readline()
print(num**3)

Fixed submission:
import sys
num = int(sys.stdin.readline())
print(num**3)

Buggy python submission (verdict: Runtime Error):
num = sys.stdin.readlines()
print(int(num)**3)

Fixed submission:
import sys
num = int(sys.stdin.readline())
print(num**3)

Buggy python submission (verdict: Runtime Error):
number = input()
print(number **3)

Fixed submission:
num = int(input())
number = num **3
print(number)

Buggy python submission (verdict: Runtime Error):
number = raw_input()
print(number **3)

Fixed submission:
num = int(input())
number = num **3
print(number)

Buggy python submission (verdict: Runtime Error):
print(type(int(input()))**3)

Fixed submission:
num = int(input())
number = num **3
print(number)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

menseki = a * b
print(menseki)

nagasa = a + a + b + b
print(nagasa)

Fixed submission:
a, b = map(int, input().split())
print(a*b, a*2 + b*2)

Buggy python submission (verdict: Runtime Error):
A,B =map(int, raw_input().split())
print A*B (A+B)*2

Fixed submission:
a, b = map(int, input().split())
print(a*b, a*2 + b*2)

Buggy python submission (verdict: Runtime Error):
A,B =map(int, raw_input().split())
print(A*B, A*2 + B*2)

Fixed submission:
a, b = map(int, input().split())
print(a*b, a*2 + b*2)
Buggy python submission (verdict: Runtime Error):
S = int(input())
h = S/3600
m = S%3600/60
s = S%60

print(h +":" + m + ":" + s)

Fixed submission:
S = int(input())
h = int(S/3600)
m = int((S%3600)/60)
s = int((S%3600)%60)
print (h,m,s,sep=":")

Buggy python submission (verdict: Runtime Error):
S = input()
h = S/3600
m = (S%3600)/60
s = (S%3600)%60
print(h,":",m,":",s)

Fixed submission:
S = int(input())
h = int(S/3600)
m = int((S%3600)/60)
s = int((S%3600)%60)
print (h,m,s,sep=":")
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a < b:
      print("a < b")
elif a > b:
      print("a > b")
else:
      print("a == b") 
     

Fixed submission:
a,b = map(int,input().split())
if a < b:
      print("a < b")
elif a > b:
      print("a > b")
else:
      print("a == b")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,raw_input().split())
if a < b:
      print(a < b)
elif a > b:
      print(a > b)
else:
      print(a == b)

Fixed submission:
a,b = map(int,input().split())
if a < b:
      print("a < b")
elif a > b:
      print("a > b")
else:
      print("a == b")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,raw_input().split())
if a < b:
      print("a < b")
elif a > b:
      print("a > b")
else:
      print("a == b")

Fixed submission:
a,b = map(int,input().split())
if a < b:
      print("a < b")
elif a > b:
      print("a > b")
else:
      print("a == b")
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

import sys
import math

def main():
  argNum = int(sys.argv[1])
  intRes = int(math.pow(argNum, 3))
  print(intRes)

if __name__ == '__main__':
  main()

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()

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

import sys

def main():
  argNum = int(sys.argv[1])
  print(intRes*intRes*intRes)

if __name__ == '__main__':
  main()

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()

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

import sys
import math

def main():
  argNum = int(sys.argv[1])
  print(int(math.pow(argNum,3)))

if __name__ == '__main__':
  main()

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()

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

import sys
import math

def main():
  argNum = int(sys.argv[1])
  print(int(math.pow(argNum,3)))

if __name__ == '__main__':
  main()

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Runtime Error):
import sys
import math

getNum = int(sys.argv[1])
print(int(math.pow(argNum,3)))

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Runtime Error):
import sys

argNum = sys.argv[1]
print(argNum*argNum*argNum)

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()

Buggy python submission (verdict: Runtime Error):
import sys

print(sys.arg[1])

Fixed submission:
# -*- coding: utf-8 -*-

import math

def main():
  N = float(input())
  print(int(math.pow(N,3)))

if __name__ == '__main__':
  main()
Buggy python submission (verdict: Runtime Error):
i = 0
x = int(input())
while x != 0:
	i += 1
	print("Case", i, ":", x, sep="")
	x = int(input())
	

Fixed submission:
i = 0
x = int(input())
while x != 0:
	i += 1
	print("Case ", i, ": ", x, sep="")
	x = int(input())
Buggy python submission (verdict: Runtime Error):
a,b,c=map(int,input(),split())
if a<b and b<c:
	print("Yes")
else:
	print("No")
	

Fixed submission:
a,b,c=map(int,input().split())
if a<b and b<c:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
a,b,c =map(int,input().sprit())

count = 0:
for x in range(a, b + 1)
    if c % x == 0:
    # print(x,"ha ", c, "no yakusuu")
    count += 1
    	
print(count)

Fixed submission:
a, b, c = map(int, input().split())

count = 0
for x in range(a, b + 1):
    if c % x == 0:
        count += 1
    	
print(count)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().sprit())

count = 0:
for x in range(a, b + 1)
    if c % x == 0:
    count += 1
    	
print(count)

Fixed submission:
a, b, c = map(int, input().split())

count = 0
for x in range(a, b + 1):
    if c % x == 0:
        count += 1
    	
print(count)

Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().sprit())

count = 0:
for x in range(a, b + 1)
    if c % x == 0:
        count += 1
    	
print(count)

Fixed submission:
a, b, c = map(int, input().split())

count = 0
for x in range(a, b + 1):
    if c % x == 0:
        count += 1
    	
print(count)
Buggy python submission (verdict: Runtime Error):
a. b = map(int, input().split())
print(a*b, 2*(a+b))

Fixed submission:
a, b = map(int, input().split())
print(a*b, 2*(a+b))
Buggy python submission (verdict: Runtime Error):
a, b, c = map (int, input().split())
if a < b < c:
	print("Yes")
else:
	print("No")
	

Fixed submission:
a, b, c = map (int, input().split())
if a < b < c:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
from math import pi
r = froat(input())
s = pi * r * r
l = 2 * pi * r
print(s, l)

Fixed submission:
from math import pi
r = float(input())
s = pi * r * r
l = 2 * pi * r
print(s, l)
Buggy python submission (verdict: Runtime Error):
S=int(input())
h=s//3600
m=(s//60)%60
s=S%60
print(h,";",m,":",s,sep="")

Fixed submission:
S = int(input())
h = S // 3600
m = (S // 60) % 60
s = S % 60
print(h,":",m,":",s,sep="")

Buggy python submission (verdict: Runtime Error):
S = int(input())
h = s / / 3600
m = (s // 60) % 60
s = S % 60
print(h,";",m,":",s,sep="")

Fixed submission:
S = int(input())
h = S // 3600
m = (S // 60) % 60
s = S % 60
print(h,":",m,":",s,sep="")

Buggy python submission (verdict: Runtime Error):
S = int(input())
h = s // 3600
m = (s // 60) % 60
s = S % 60
print(h,":",m,":",s,sep="")

Fixed submission:
S = int(input())
h = S // 3600
m = (S // 60) % 60
s = S % 60
print(h,":",m,":",s,sep="")
Buggy python submission (verdict: Runtime Error):
a,b,c = map(int,input().split())
if a < b < c:
	print("Yes")
else:
	print("No"

Fixed submission:
a,b,c = map(int,input().split())
if a < b < c:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
while True:
   a, op, b = input().split()
   a = int(a)
   b = int(b)
   if op == "+":
	   print(a + b)
   elif op == "-":
	   print(a - b)
   elif op == "*":
	   print(a * b)
   elif op == "/":
	   print(a // b)

Fixed submission:
while True:
   a, op, b = input().split()
   a = int(a)
   b = int(b)
   if op == "+":
	   print(a + b)
   elif op == "-":
	   print(a - b)
   elif op == "*":
	   print(a * b)
   elif op == "/":
	   print(a // b)
   elif op == "?":
   	   break

Buggy python submission (verdict: Runtime Error):
while True:
   a, op, b = input().split()
   a = int(a)
   b = int(b)
   if op == "+":
	   print(a + b)
   elif op == "-":
	   print(a - b)
   elif op == "*":
	   print(a * b)
   elif op == "/":
	   print(a // b)

Fixed submission:
while True:
   a, op, b = input().split()
   a = int(a)
   b = int(b)
   if op == "+":
	   print(a + b)
   elif op == "-":
	   print(a - b)
   elif op == "*":
	   print(a * b)
   elif op == "/":
	   print(a // b)
   elif op == "?":
   	   break
Buggy python submission (verdict: Runtime Error):
a,b,c = map (int, input(),split())
if a < b and < c:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = map (int, input().split())
if a < b < c:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
a,b,c = map (int, input(),split())
if a < b < c:
    print("Yes")
else:
    print("No")

Fixed submission:
a, b, c = map (int, input().split())
if a < b < c:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a, b, c = map (int, input().split())
if a < b:
	if a < c:
		if b < c:
			print(a, b, c)
			else:
				print(a, c, b)
		else:
			print(c, a, b)
else:
	if b < c:
		if a < c:
			print(b, a, c)
		else:
			print(b, c, a)
	else:
		print(c, b, a)
		

Fixed submission:
a, b, c = map (int, input().split())
if a < b:
	if a < c:
		if b < c:
			print(a, b, c)
		else:
			print(a, c, b)
	else:
		print(c, a, b)
else:
	if b < c:
		if a < c:
			print(b, a, c)
		else:
			print(b, c, a)
	else:
		print(c, b, a)

Buggy python submission (verdict: Runtime Error):
a, b, c = map (int, input().split())
if a < b:
	if a < c:
		if b < c:
			print(a, b, c)
			else:
				print(a, c, b)
		else:
			print(c, a, b)
else:
	if b < c:
		if a < c:
			print(b, a, c)
		else:
			print(b, c, a)
	else:
		print(c, b, a)
		

Fixed submission:
a, b, c = map (int, input().split())
if a < b:
	if a < c:
		if b < c:
			print(a, b, c)
		else:
			print(a, c, b)
	else:
		print(c, a, b)
else:
	if b < c:
		if a < c:
			print(b, a, c)
		else:
			print(b, c, a)
	else:
		print(c, b, a)
Buggy python submission (verdict: Runtime Error):
n = int(input())
dat = list(map(int. input().split()))
print(min(dat). max(dat).sum(dat))

Fixed submission:

n = int(input())
dat = list(map(int, input(). split()))
print(min(dat), max(dat), sum(dat))

Buggy python submission (verdict: Runtime Error):

n = int(input())
dat = list(map(int. input().split()))
print(min(dat). max(dat). sum(dat))

Fixed submission:

n = int(input())
dat = list(map(int, input(). split()))
print(min(dat), max(dat), sum(dat))

Buggy python submission (verdict: Runtime Error):

n = int(input())
dat = list(map(int. input().split()))
print(min(dat). max(dat). sum(dat))

Fixed submission:

n = int(input())
dat = list(map(int, input(). split()))
print(min(dat), max(dat), sum(dat))
Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
x = input()
h = x / 3600
m = x % 3600 / 60
s = x % 3600 % 60
print(h+":"+m+":"+s)

Fixed submission:
# coding: utf-8
# Here your code !
x = input()
h = int(x) / 3600
m = (int(x) % 3600) / 60
s = int(x) - int(h) * 3600 - int(m) * 60
print('%d:%d:%d'%(h,m,s))

Buggy python submission (verdict: Runtime Error):
# coding: utf-8
# Here your code !
x = input('The Integer is ')
# x = input('The Integer is ')
h = int(x) / 3600
m = (int(x) % 3600) / 60
s = int(x) - int(h) * 3600 - int(m) * 60
print(int(h)+':'+int(m)+':'+int(s))

Fixed submission:
# coding: utf-8
# Here your code !
x = input()
h = int(x) / 3600
m = (int(x) % 3600) / 60
s = int(x) - int(h) * 3600 - int(m) * 60
print('%d:%d:%d'%(h,m,s))
Buggy python submission (verdict: Runtime Error):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, input().rstrip('\n').split()))
    pw = pow(2, n)
    dp = [10 ** 15] * pw
    dp[0] = 0
    for _ in range(m):
        a, b = list(map(int, input().rstrip('ap(int, input().rstrip('\n').split())))
        for i in range(pw):
            dp[c | i] = min(dp[c | i], dp[i] + a)
    print(dp[-1] if dp[-1] != 10 ** 15 else -1)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, input().rstrip('\n').split()))
    pw = 2 ** n
    dp = [10 ** 20] * pw
    dp[0] = 0
    for i in range(m):
        a, b = list(map(int, input().rstrip('\n').split()))
        c = sum(2 ** (i - 1) for i in list(map(int, input().rstrip('\n').split())))
        for j in range(pw):
            if dp[j | c] > dp[j] + a:
                dp[j | c] = dp[j] + a
    if dp[-1] == 10 ** 20:
        print(-1)
    else:
        print(dp[-1])


if __name__ == '__main__':
    solve()

Buggy python submission (verdict: Time Limit Exceeded):
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, input().rstrip('\n').split()))
    abl = []
    cl = []
    for i in range(m):
        abl.append(list(map(int, input().rstrip('\n').split())))
        cl.append(list(map(int, input().rstrip('\n').split())))
    dp = [[set(), 0] for _ in range(2 ** m)]
    mt = 10 ** 20
    #各bitを総検索
    for i in range(2 ** m):
        bt = bin(i)
        #先頭bitに対して処理
        if i >= 1 and len(bt[2:]) - 1 < m:
            for c in cl[len(bt[2:])-1]:
                dp[i][0].add(c)
            dp[i][1] += abl[len(bt[2:])-1][0]
        #先頭bitより後ろのbitが同じパターンの解放済とコストを追加
        if i >= 2:
            for c in dp[int(bt[3:], 2)][0]:
                dp[i][0].add(c)
            dp[i][1] += dp[int(bt[3:], 2)][1]
        if len(dp[i][0]) == n:
            mt = min(mt, dp[i][1])
    print(mt if mt != 10 ** 20 else -1)


if __name__ == '__main__':
    solve()


Fixed submission:
import sys


def solve():
    input = sys.stdin.readline
    mod = 10 ** 9 + 7
    n, m = list(map(int, input().rstrip('\n').split()))
    pw = 2 ** n
    dp = [10 ** 20] * pw
    dp[0] = 0
    for i in range(m):
        a, b = list(map(int, input().rstrip('\n').split()))
        c = sum(2 ** (i - 1) for i in list(map(int, input().rstrip('\n').split())))
        for j in range(pw):
            if dp[j | c] > dp[j] + a:
                dp[j | c] = dp[j] + a
    if dp[-1] == 10 ** 20:
        print(-1)
    else:
        print(dp[-1])


if __name__ == '__main__':
    solve()