Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[input for i in range(n)]
maxv=a[0]
minv=a[0]
for j in range(n):
    maxv=max(maxv,a[j])
    minv=min(minv,a[j])
print(maxv-minv)


Fixed submission:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
maxv=a[1]-a[0]
minv=a[0]
for j in range(1,n):
    maxv=max(maxv,a[j]-minv)
    minv=min(minv,a[j])
print(maxv)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[input() for i in range(n)]
maxv=a[0]
minv=a[0]
for j in range(n):
    maxv=max(maxv,a[j])
    minv=min(minv,a[j])
print(maxv-minv)


Fixed submission:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
maxv=a[1]-a[0]
minv=a[0]
for j in range(1,n):
    maxv=max(maxv,a[j]-minv)
    minv=min(minv,a[j])
print(maxv)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(n):
    a.append(input())
maxv=a[0]
minv=a[0]
for j in range(n):
    maxv=max(maxv,a[j])
    minv=min(minv,a[j])
print(maxv-minv)


Fixed submission:
n=int(input())
a=[]
for i in range(n):
    a.append(int(input()))
maxv=a[1]-a[0]
minv=a[0]
for j in range(1,n):
    maxv=max(maxv,a[j]-minv)
    minv=min(minv,a[j])
print(maxv)
Buggy python submission (verdict: Runtime Error):
i = input()
i.split()
a = i[0]
b = i[1]

s = a * b
l = 2 * a + 2 * b

print(s,l)



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

s = a * b
l = 2 * a + 2 * b

print(s,l)

Buggy python submission (verdict: Runtime Error):
i = input()
i.split()
a = int(i[0])
b = int(i[2])

s = a * b
l = 2 * a + 2 * b

print(s,l)



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

s = a * b
l = 2 * a + 2 * b

print(s,l)
Buggy python submission (verdict: Runtime Error):
i = int(iput())

if i/3600 != 0:
    h = i/3600
    a = a - 3600 * h
if i/60 != 0:
    m = i/3600
    a = a - 60 * m

print(h,":",m,":",a)


Fixed submission:
i = int(input())

h = 0
m = 0

if i/3600 >= 1:
    h = int(i/3600)
    i = i - 3600 * h
if i/60 >= 1:
    m = int(i/60)
    i = i - 60 * m
    
s = str(h) + ":" + str(m) + ":" + str(i)

print(s)

Buggy python submission (verdict: Runtime Error):
i = int(input())

if i/3600 != 0:
    h = i/3600
    a = a - 3600 * h
if i/60 != 0:
    m = i/3600
    a = a - 60 * m

print(h,":",m,":",a)


Fixed submission:
i = int(input())

h = 0
m = 0

if i/3600 >= 1:
    h = int(i/3600)
    i = i - 3600 * h
if i/60 >= 1:
    m = int(i/60)
    i = i - 60 * m
    
s = str(h) + ":" + str(m) + ":" + str(i)

print(s)

Buggy python submission (verdict: Runtime Error):
i = int(input())

if i/3600 != 0:
    h = i/3600
    i = i - 3600 * h
if i/60 != 0:
    m = i/3600
    i = i - 60 * m

print(h,":",m,":",a)


Fixed submission:
i = int(input())

h = 0
m = 0

if i/3600 >= 1:
    h = int(i/3600)
    i = i - 3600 * h
if i/60 >= 1:
    m = int(i/60)
    i = i - 60 * m
    
s = str(h) + ":" + str(m) + ":" + str(i)

print(s)

Buggy python submission (verdict: Runtime Error):
i = int(input())

h = 0
m = 0

if i/3600 != 0:
    h = i/3600
    i = i - 3600 * h
if i/60 != 0:
    m = i/3600
    i = i - 60 * m

print(h,":",m,":",a)


Fixed submission:
i = int(input())

h = 0
m = 0

if i/3600 >= 1:
    h = int(i/3600)
    i = i - 3600 * h
if i/60 >= 1:
    m = int(i/60)
    i = i - 60 * m
    
s = str(h) + ":" + str(m) + ":" + str(i)

print(s)

Buggy python submission (verdict: Runtime Error):
i = int(input())

h = 0
m = 0

if i/3600 > 1:
    h = int(i/3600)
    i = i - 3600 * h
if i/60 > 1:
    m = int(i/60)
    i = i - 60 * m
    
s = h + ":" + m + ":" + i

print(s)


Fixed submission:
i = int(input())

h = 0
m = 0

if i/3600 >= 1:
    h = int(i/3600)
    i = i - 3600 * h
if i/60 >= 1:
    m = int(i/60)
    i = i - 60 * m
    
s = str(h) + ":" + str(m) + ":" + str(i)

print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().strip().split(' ')))

for i in range(0, n // 2):
    s[i], s[n - i] = s[n - i], s[i]

for i in range(0, len(s)):
    if i != len(s - 1):
        print(s[i], end=" ")
    else:
        print(s[i])



Fixed submission:
n = int(input())
s = list(map(int, input().strip().split(' ')))
t = n // 2

for i in range(0, n // 2):
    s[i], s[n - i - 1] = s[n - i - 1], s[i]

for i in range(0, len(s)):
    if i != len(s) - 1:
        print(s[i], end=" ")
    else:
        print(s[i])

Buggy python submission (verdict: Runtime Error):
n = int(input())
s = list(map(int, input().strip().split(' ')))
t = n // 2

for i in range(0, t):
    s[i], s[n - i] = s[n - i], s[i]

for i in range(0, len(s)):
    if i != len(s - 1):
        print(s[i], end=" ")
    else:
        print(s[i])



Fixed submission:
n = int(input())
s = list(map(int, input().strip().split(' ')))
t = n // 2

for i in range(0, n // 2):
    s[i], s[n - i - 1] = s[n - i - 1], s[i]

for i in range(0, len(s)):
    if i != len(s) - 1:
        print(s[i], end=" ")
    else:
        print(s[i])
Buggy python submission (verdict: Runtime Error):
n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]

#print(arr)

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            #print(x,y,z)
            arr[x-1][z-1]=1
            #print(arr)
            d=d+1

print(arr)


Fixed submission:

n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]
#for i in arr:
    #print(' '.join(map(str, i)))

#print(arr)

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            #print(x,y,z)
            arr[x-1][z-1]=1
            #print(arr)
            d=d+1

#print(arr)
for i in arr:
    print(' '.join(map(str, i)))

Buggy python submission (verdict: Runtime Error):
n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            arr[x-1][z-1]=1
            d=d+1

print(arr)


Fixed submission:

n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]
#for i in arr:
    #print(' '.join(map(str, i)))

#print(arr)

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            #print(x,y,z)
            arr[x-1][z-1]=1
            #print(arr)
            d=d+1

#print(arr)
for i in arr:
    print(' '.join(map(str, i)))

Buggy python submission (verdict: Runtime Error):
n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            arr[x-1][z-1]=1
            d=d+1

print(arr)


Fixed submission:

n=int(input())

arr = [[0 for i in range(n)] for j in range(n)]
#for i in arr:
    #print(' '.join(map(str, i)))

#print(arr)

for i in range(0,n):
    l=raw_input().split()
    if(int(l[1])>=1):
        x=int(l[0])
        y=int(l[1])
        p=len(l)
        d=0
        while(2+d<p):
            z=int(l[2+d])
            #print(x,y,z)
            arr[x-1][z-1]=1
            #print(arr)
            d=d+1

#print(arr)
for i in arr:
    print(' '.join(map(str, i)))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a[n]={0}
for i in range(1,n):
    a[i]=int(input())



Fixed submission:

def is_prime(n):

    if n == 2:
        return True
    elif n < 2 or n & 1 == 0:
        return False
    for i in range(3, int(n**0.5) + 1, 2):
        if n % i == 0:
            return False
    return True

N = int(input())
cnt = 0
for i in range(N):
    e = int(input())
    if is_prime(e):
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
for i in range(1,n):
    a[i]=int(input())



Fixed submission:

def is_prime(n):

    if n == 2:
        return True
    elif n < 2 or n & 1 == 0:
        return False
    for i in range(3, int(n**0.5) + 1, 2):
        if n % i == 0:
            return False
    return True

N = int(input())
cnt = 0
for i in range(N):
    e = int(input())
    if is_prime(e):
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(1,n):
    a[i]=int(input())



Fixed submission:

def is_prime(n):

    if n == 2:
        return True
    elif n < 2 or n & 1 == 0:
        return False
    for i in range(3, int(n**0.5) + 1, 2):
        if n % i == 0:
            return False
    return True

N = int(input())
cnt = 0
for i in range(N):
    e = int(input())
    if is_prime(e):
        cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=[]
for i in range(1,n-1):
    a[i]=int(input())



Fixed submission:

def is_prime(n):

    if n == 2:
        return True
    elif n < 2 or n & 1 == 0:
        return False
    for i in range(3, int(n**0.5) + 1, 2):
        if n % i == 0:
            return False
    return True

N = int(input())
cnt = 0
for i in range(N):
    e = int(input())
    if is_prime(e):
        cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
#For integers x and y, if x ≥ y, then gcd(x, y) = gcd(y, x%y)

x,y=map(int,input().split())
r=x%y


while r!=0:
    if x>=y:
        x=y
        y=r
        r=x%y
print(y)



Fixed submission:
x,y=map(int,input().split())
r=x%y

while r!=0:
        x=y
        y=r
        r=x%y
print(y)
Buggy python submission (verdict: Runtime Error):

print("縦と横の長さを入力")
a=int(input("a:"))
b=int(input("b:"))

print("面積:",a*b)
print("周の長さ",a*2+b*2)



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):
print("縦と横の長さを入力")

a=int(input("a:"))
b=int(input("b:"))

print(a*b)
print(a*2+b*2)



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):

a=int(input("a:"))
b=int(input("b:"))

print(a*b)
print(a*2+b*2)



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):
print("縦と横の長さを入力")

a=float(input("a:"))
b=float(input("b:"))

print(a*b)
print(a*2+b*2)



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):
print("縦と横の長さを入力")

a=int(input())
b=int(input())

print(a*b)
print(a*2+b*2)




Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):
print("縦と横の長さを入力")

a=int(input())
b=int(input())

print(a*b)
print(a*2+b*2)



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):
print("縦と横の長さを入力")

a=int(input())
b=int(input())

print(str(a*b))
print(str(a*2+b*2))



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)

Buggy python submission (verdict: Runtime Error):
print("縦と横の長さを入力")

a=int(input())
b=int(input())

print(a*b,a*2+b*2)



Fixed submission:

a,b=map(int,input().split())

r=a*b
length=a*2+b*2
print(r,length)
Buggy python submission (verdict: Runtime Error):
for i in range(0, 3000):
    array = map(int, input().split(' '))
    if x == 0 and y == 0:
        break
    else:
        print(' '.join(map(str, sorted(array))))


Fixed submission:
for i in range(0, 3000):
    array = [int(x) for x in input().split(' ')]
    if array[0] == 0 and array[1] == 0:
        break
    else:
        print(' '.join([str(x) for x in sorted(array)]))

Buggy python submission (verdict: Runtime Error):
for i in range(0, 3000):
    array = map(int, input().split(' '))
    if array[0] == 0 and array[1] == 0:
        break
    else:
        print(' '.join(map(str, sorted(array))))


Fixed submission:
for i in range(0, 3000):
    array = [int(x) for x in input().split(' ')]
    if array[0] == 0 and array[1] == 0:
        break
    else:
        print(' '.join([str(x) for x in sorted(array)]))

Buggy python submission (verdict: Runtime Error):
for i in range(0, 3000):
    array = map(int, input().split(' '))
    print(array)
    if array[0] == 0 and array[1] == 0:
        break
    else:
        print(' '.join(map(str, sorted(array))))


Fixed submission:
for i in range(0, 3000):
    array = [int(x) for x in input().split(' ')]
    if array[0] == 0 and array[1] == 0:
        break
    else:
        print(' '.join([str(x) for x in sorted(array)]))
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())
print(round(r**2 * math.pi, 6), round(r * 2 * math.pi, 6))


Fixed submission:
import math
r = float(input())
print(round(r**2 * math.pi, 6), round(r * 2 * math.pi, 6))
Buggy python submission (verdict: Runtime Error):
x = input()
int(x)
print(x**3)



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

Buggy python submission (verdict: Runtime Error):
x = input()
y = int(x)
return(y**3)



Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
i = 0
while input() != 0:
    i += 1
    print('Case ',i,': ',input(),sep='')



Fixed submission:
i = 0
while True:
    x = int(input())
    i += 1
    if x == 0:
        break
    print("Case {}: {}".format(i, x))
Buggy python submission (verdict: Runtime Error):
r = int(input())
x = r * r * 3.14159265
y = r * 2 * 3.14159265
print(x, y)



Fixed submission:
r = float(input())
x = r * r * 3.14159265359
y = r * 2 * 3.14159265359
print("{0:.10f} {1:.10f}".format(x, y))

Buggy python submission (verdict: Runtime Error):
r = float(input())
x = r * r * 3.14159265
y = r * 2 * 3.14159265
print("{0:f} {1:f}", format(x, y))



Fixed submission:
r = float(input())
x = r * r * 3.14159265359
y = r * 2 * 3.14159265359
print("{0:.10f} {1:.10f}".format(x, y))
Buggy python submission (verdict: Runtime Error):
while True:
    a, b, c = input().split()
    if b == '?':
        break
    a = int(a)
    c = int(c)
    if b == '+':
        print(a + b)
    if b == '-':
        print(a - b)
    if b == '*':
        print(a * b)
    if b == '/':
        print(a / b)



Fixed submission:
while True:
    a, b, c = input().split()
    if b == '?':
        break
    a = int(a)
    c = int(c)
    if b == '+':
        print(a + c)
    if b == '-':
        print(a - c)
    if b == '*':
        print(a * c)
    if b == '/':
        print(a // c)
Buggy python submission (verdict: Runtime Error):
cardset = ["S 1","S 2","S 3","S 4","S 5","S 6","S 7","S 8","S 9","S 10","S 11","S 12","S 13","H 1","H 2","H 3","H 4","H 5","H 6","H 7","H 8","H 9","H 10","H 11","H 12","H 13","C 1","C 2","C 3","C 4","C 5","C 6","C 7","C 8","C 9","C 10","C 11","C 12","C 13","D 1","D 2","D 3","D 4","D 5","D 6","D 7","D 8","D 9","D 10","D 11","D 12","D 13"]
n = input()
while True:
    try:
        cardset.remove(str(input()))
    except ValueError:
        break
for x in cardset:
    print(x)



Fixed submission:
cardset = ["S 1","S 2","S 3","S 4","S 5","S 6","S 7","S 8","S 9","S 10","S 11","S 12","S 13","H 1","H 2","H 3","H 4","H 5","H 6","H 7","H 8","H 9","H 10","H 11","H 12","H 13","C 1","C 2","C 3","C 4","C 5","C 6","C 7","C 8","C 9","C 10","C 11","C 12","C 13","D 1","D 2","D 3","D 4","D 5","D 6","D 7","D 8","D 9","D 10","D 11","D 12","D 13"]
n = int(input())
i = 0
while i < n:
    cardset.remove(str(input()))
    i += 1
for x in cardset:
    print(x)

Buggy python submission (verdict: Runtime Error):
cardset = ["S 1","S 2","S 3","S 4","S 5","S 6","S 7","S 8","S 9","S 10","S 11","S 12","S 13","H 1","H 2","H 3","H 4","H 5","H 6","H 7","H 8","H 9","H 10","H 11","H 12","H 13","C 1","C 2","C 3","C 4","C 5","C 6","C 7","C 8","C 9","C 10","C 11","C 12","C 13","D 1","D 2","D 3","D 4","D 5","D 6","D 7","D 8","D 9","D 10","D 11","D 12","D 13"]
n = input()
while True:
    try:
        cardset.remove(str(input()))
    except ValueError:
        break
for x in cardset:
    print(x)



Fixed submission:
cardset = ["S 1","S 2","S 3","S 4","S 5","S 6","S 7","S 8","S 9","S 10","S 11","S 12","S 13","H 1","H 2","H 3","H 4","H 5","H 6","H 7","H 8","H 9","H 10","H 11","H 12","H 13","C 1","C 2","C 3","C 4","C 5","C 6","C 7","C 8","C 9","C 10","C 11","C 12","C 13","D 1","D 2","D 3","D 4","D 5","D 6","D 7","D 8","D 9","D 10","D 11","D 12","D 13"]
n = int(input())
i = 0
while i < n:
    cardset.remove(str(input()))
    i += 1
for x in cardset:
    print(x)
Buggy python submission (verdict: Time Limit Exceeded):
# coding=utf-8
from collections import deque
n = int(input())
deque = deque()

for i in range(n):
    inp = list(input().split())
    if inp[0] == 'deleteFirst':
        deque.popleft()
    elif inp[0] == 'deleteLast':
        deque.pop()
    elif inp[0] == 'insert':
        deque.appendleft(inp[1])
    elif inp[0] == 'delete':
        if inp[1] in deque:
            deque.remove(inp[1])

print(*deque)

Fixed submission:
# coding=utf-8
from collections import deque
n = int(input())
deque = deque()
input_lines = [input() for x in range(n)]

for i in range(n):
    inp = input_lines[i].split()
    if inp[0] == 'insert':
        deque.appendleft(inp[1])
    elif inp[0] == 'deleteFirst':
        deque.popleft()
    elif inp[0] == 'deleteLast':
        deque.pop()
    else:
        if inp[1] in deque:
            deque.remove(inp[1])

print(*deque)
Buggy python submission (verdict: Time Limit Exceeded):
# coding=utf-8

n = int(input())
dic_list = []

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        dic_list.append(cmd[1])
    else:
        if cmd[1] in dic_list:
            print('yes')
        else:
            print('no')

Fixed submission:
# coding=utf-8

n = int(input())
dic = set()

for i in range(n):
    cmd = input().split()
    if cmd[0] == 'insert':
        dic.add(cmd[1])
    else:
        if cmd[1] in dic:
            print('yes')
        else:
            print('no')
Buggy python submission (verdict: Time Limit Exceeded):
# coding=utf-8

class Node:
    def __init__(self, idx, degree, children=None):
        self.id = idx
        self.parent = -1 #??????
        self.depth = 0 #??????
        self.type = None #??????
        self.children = children

n = int(input())
data = [list(map(int, input().split())) for x in range(n)]
node_list = []

for data_row in data:
    idx, degree, *children = data_row
    node = Node(idx, degree, children)
    node_list.append(node)

### set parent & type ###
for i, node in enumerate(node_list):
    if node.children:
        node.type = "internal node"
        for child in node.children:
            node_list[child].parent = i
    else:
        node.type = "leaf"

### calc depth ###
for i, node in enumerate(node_list):
    depth = 0
    parent = node.parent
    #?????\???type
    if parent == -1:
        node.type = "root"
    while parent != -1:
        parent = node_list[parent].parent
        depth += 1
    node.depth = depth

for node in node_list:
    print("node {}: parent = {}, depth = {}, {}, {}".format(node.id, node.parent, node.depth, node.type, node.children))

Fixed submission:
# coding=utf-8

class Node:
    def __init__(self, idx, degree, children=None):
        self.id = idx
        self.parent = -1 #??????
        self.depth = 0 #??????
        self.type = None #??????
        self.children = children

n = int(input())
data = [list(map(int, input().split())) for x in range(n)]
node_list = [None for i in range(n)]

for data_row in data:
    idx, degree, *children = data_row
    node = Node(idx, degree, children)
    node_list[idx] = node

### set parent & type ###
for node in node_list:
    i = node.id
    if node.children:
        node.type = "internal node"
        for child in node.children:
            node_list[child].parent = i
    else:
        node.type = "leaf"

### calc depth ###
for i, node in enumerate(node_list):
    depth = 0
    parent = node.parent
    #?????\???type
    if parent == -1:
        node.type = "root"
    while parent != -1:
        parent = node_list[parent].parent
        depth += 1
    node.depth = depth

for node in node_list:
    print("node {}: parent = {}, depth = {}, {}, {}".format(node.id, node.parent, node.depth, node.type, node.children))
Buggy python submission (verdict: Runtime Error):
# coding=utf-8
from collections import deque

def reconstruction(left, right):
    global pre_order
    global in_order
    global post_order
    global n

    if left > right:
        return None
    elif left == right:
        root = pre_order.popleft()
        post_order.append(root)
        return None
    else:
        root = pre_order.popleft()

    root_pos = in_order.index(root)
    reconstruction(left, root_pos-1)
    reconstruction(root_pos+1, right)
    post_order.append(root)

n = int(input())
pre_order = deque(map(int, input().split()))
in_order = deque(map(int, input().split()))
post_order = []

reconstruction(0, n-1)
print(*post_order)

Fixed submission:
# coding=utf-8
def reconstruction(left, right):
    global pre_order
    global in_order
    global post_order
    global n

    if left > right:
        return None
    elif left == right:
        root = pre_order.pop(0)
        post_order.append(root)
        return None
    else:
        root = pre_order.pop(0)

    root_pos = in_order.index(root)
    reconstruction(left, root_pos-1)
    reconstruction(root_pos+1, right)
    post_order.append(root)

n = int(input())
pre_order = list(map(int, input().split()))
in_order = list(map(int, input().split()))
post_order = []

reconstruction(0, n-1)
print(*post_order)

Buggy python submission (verdict: Runtime Error):
# coding=utf-8
from collections import deque

def reconstruction(left, right):
    global pre_order
    global in_order
    global post_order
    global n

    if left > right:
        return None
    elif left == right:
        root = pre_order.popleft()
        post_order.append(root)
        return None
    else:
        root = pre_order.popleft()

    root_pos = in_order.index(root)
    reconstruction(left, root_pos-1)
    reconstruction(root_pos+1, right)
    post_order.append(root)

n = int(input())
pre_order = deque(map(int, input().split()))
in_order = deque(map(int, input().split()))
post_order = []

reconstruction(0, n-1)
print(*post_order)

Fixed submission:
# coding=utf-8
def reconstruction(left, right):
    global pre_order
    global in_order
    global post_order
    global n

    if left > right:
        return None
    elif left == right:
        root = pre_order.pop(0)
        post_order.append(root)
        return None
    else:
        root = pre_order.pop(0)

    root_pos = in_order.index(root)
    reconstruction(left, root_pos-1)
    reconstruction(root_pos+1, right)
    post_order.append(root)

n = int(input())
pre_order = list(map(int, input().split()))
in_order = list(map(int, input().split()))
post_order = []

reconstruction(0, n-1)
print(*post_order)
Buggy python submission (verdict: Runtime Error):
x = raw_input()
print(pow(x,3))

Fixed submission:
x = int(input())
print(pow(x,3))

Buggy python submission (verdict: Runtime Error):
x = raw_input()
print(pow(x,3))

Fixed submission:
x = int(input())
print(pow(x,3))
Buggy python submission (verdict: Runtime Error):
list = input().split()
print(list[0]*list[1], list[0]*2+list[1]*2)

Fixed submission:
list = input().split()
x = int(list[0])
y = int(list[1])
print(x*y, x*2+y*2)