Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
x = map(int,raw_input().split())
i = 0
while x[i] <> 0:
  print "Case %d: %d" %d(i,x[i])
  i++

Fixed submission:
i = 0
while 1:
    x = input()
    i += 1
    if x == '0':
        break
    print ('Case %s: %s' % (i,x))

Buggy python submission (verdict: Runtime Error):
x = map(int,raw_input().split())
i = 0
while x[i] <> 0:
  print "Case %d: %d" %(i,x[i])
  i += 1

Fixed submission:
i = 0
while 1:
    x = input()
    i += 1
    if x == '0':
        break
    print ('Case %s: %s' % (i,x))

Buggy python submission (verdict: Runtime Error):
x = map(int,raw_input().split())
i = 0
while x[i] <> 0:
  print "Case %d: %d" %(i,x[i])
  i += 1

Fixed submission:
i = 0
while 1:
    x = input()
    i += 1
    if x == '0':
        break
    print ('Case %s: %s' % (i,x))

Buggy python submission (verdict: Runtime Error):
x = map(int,raw_input().split())
i = 0
while x[i] <> 0:
  print "Case %s: %s" %(i,x[i])
  i += 1

Fixed submission:
i = 0
while 1:
    x = input()
    i += 1
    if x == '0':
        break
    print ('Case %s: %s' % (i,x))
Buggy python submission (verdict: Time Limit Exceeded):
dbg = False

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

if a > b:
    x, y = a, b
else:
    x, y = b, a

for i in range(1, y+1):
    if y % i == 0:
        gcd_tmp = int(y / i)
        if dbg: print(gcd_tmp)
        if x % gcd_tmp == 0:
            gcd = gcd_tmp
            break

print(gcd)

Fixed submission:
dbg = False

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

if a > b:
    x, y = a, b
else:
    x, y = b, a

divs = [1]
for i in range(1, int((y+1)/2)+1):
    gcd_tmp = int(y / i)
    if dbg: print('%d, %d' % (i, gcd_tmp))
    if i > gcd_tmp:
        break
    if y % i == 0:
        if x % gcd_tmp == 0:
            print(gcd_tmp)
            exit()
        elif x % i == 0:
            divs.append(i)

print(max(divs))

Buggy python submission (verdict: Runtime Error):
dbg = False

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

if a > b:
    x, y = a, b
else:
    x, y = b, a

for i in range(1, int((y+1)/2)+1):
    if y % i == 0:
        gcd_tmp = int(y / i)
        if dbg: print(gcd_tmp)
        if x % gcd_tmp == 0:
            print(gcd_tmp)
            exit()

print(1)

Fixed submission:
dbg = False

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

if a > b:
    x, y = a, b
else:
    x, y = b, a

divs = [1]
for i in range(1, int((y+1)/2)+1):
    gcd_tmp = int(y / i)
    if dbg: print('%d, %d' % (i, gcd_tmp))
    if i > gcd_tmp:
        break
    if y % i == 0:
        if x % gcd_tmp == 0:
            print(gcd_tmp)
            exit()
        elif x % i == 0:
            divs.append(i)

print(max(divs))

Buggy python submission (verdict: Time Limit Exceeded):
dbg = False

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

if a > b:
    x, y = a, b
else:
    x, y = b, a

for i in range(1, int((y+1)/2)+1):
    if y % i == 0:
        gcd_tmp = int(y / i)
        if dbg: print(gcd_tmp)
        if x % gcd_tmp == 0:
            print(gcd_tmp)
            exit()

print(1)

Fixed submission:
dbg = False

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

if a > b:
    x, y = a, b
else:
    x, y = b, a

divs = [1]
for i in range(1, int((y+1)/2)+1):
    gcd_tmp = int(y / i)
    if dbg: print('%d, %d' % (i, gcd_tmp))
    if i > gcd_tmp:
        break
    if y % i == 0:
        if x % gcd_tmp == 0:
            print(gcd_tmp)
            exit()
        elif x % i == 0:
            divs.append(i)

print(max(divs))
Buggy python submission (verdict: Time Limit Exceeded):
def isPrime(n):
    for i in range(2, int(n/2)+1):
        if n % i == 0:
            return False
    return True

N = int(input())
nums = [int(input()) for i in range(N)]
print(sum([isPrime(n) for n in nums]))

Fixed submission:
import math

def isPrime(n):
    for i in range(2, int(math.sqrt(n))+1):
        if n % i == 0:
            return False
    return True

N = int(input())
nums = [int(input()) for i in range(N)]
print(sum([isPrime(n) for n in nums]))
Buggy python submission (verdict: Runtime Error):
import math

n = int(input())
nums = [int(input()) for i in range(n)]

minNum = nums[0]
maxDiff = -math.inf
for i in nums[1:]:
    diff = i - minNum
    if diff > maxDiff:
        maxDiff = diff
    if minNum > i:
        minNum = i

print(maxDiff)

Fixed submission:
n = int(input())
nums = [int(input()) for i in range(n)]

minNum = nums[0]
maxDiff = False
for i in nums[1:]:
    diff = i - minNum
    if maxDiff == False or diff > maxDiff:
        maxDiff = diff
    if minNum > i:
        minNum = i

print(maxDiff)

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

n = int(input())
nums = [int(input()) for i in range(n)]

minNum = nums[0]
maxDiff = -math.inf
for i in nums[1:]:
    diff = i - minNum
    if diff > maxDiff:
        maxDiff = diff
    if minNum > i:
        minNum = i

print(maxDiff)

Fixed submission:
n = int(input())
nums = [int(input()) for i in range(n)]

minNum = nums[0]
maxDiff = False
for i in nums[1:]:
    diff = i - minNum
    if maxDiff == False or diff > maxDiff:
        maxDiff = diff
    if minNum > i:
        minNum = i

print(maxDiff)
Buggy python submission (verdict: Runtime Error):
import math
x1,y1,x2,y2 = map(int, input().split())
print(math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))

Fixed submission:
import math
x1,y1,x2,y2 = map(float, input().split())
print(math.sqrt(pow(x2-x1, 2) + pow(y2-y1, 2)))
Buggy python submission (verdict: Runtime Error):
S = input()

s = S % 60
m = int(S / 60) % 60
h = int(int(S / 60) / 60)

print('%d:%d:%d' % (h,m,s))

Fixed submission:
S = int(input())

s = S % 60
m = int(S / 60) % 60
h = int(int(S / 60) / 60)

print('%d:%d:%d' % (h,m,s))
Buggy python submission (verdict: Runtime Error):
line = input()
r = int(line)

import math

print('%f %f' % (r*r*math.pi, 2*r*math.pi) )

Fixed submission:
line = input()
r = float(line)

import math

print('%f %f' % (r*r*math.pi, 2*r*math.pi) )

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

pi = 3.1415926535

print('%f %f' % (r*r*pi, 2*r*pi) )

Fixed submission:
line = input()
r = float(line)

import math

print('%f %f' % (r*r*math.pi, 2*r*math.pi) )
Buggy python submission (verdict: Runtime Error):
n,m = map(int, input().split())

A = []
for i in range(n):
    A.append(list(map(int, input().split())))

b = []
for i in range(m):
    b.append(int(input()))

import numpy as np
c = np.array(A).dot(b)

for ci in c:
    print(ci)

Fixed submission:
n,m = map(int, input().split())

A = []
for i in range(n):
    A.append(list(map(int, input().split())))

b = [0] * m
for i in range(m):
    b[i] = int(input())

from operator import mul
for i in range(n):
    print(sum(map(mul, A[i], b)))

Buggy python submission (verdict: Runtime Error):
import numpy as np

n,m = map(int, input().split())

A = []
for i in range(n):
    A.append(list(map(int, input().split())))

b = []
for i in range(m):
    b.append(int(input()))

c = np.array(A).dot(b)

for ci in c:
    print(ci)

Fixed submission:
n,m = map(int, input().split())

A = []
for i in range(n):
    A.append(list(map(int, input().split())))

b = [0] * m
for i in range(m):
    b[i] = int(input())

from operator import mul
for i in range(n):
    print(sum(map(mul, A[i], b)))
Buggy python submission (verdict: Runtime Error):
import sys

ERROR_INPUT = 'input is invalid'
ERROR_INPUT_NOT_UNIQUE = 'input is not unique'


def main():
    S = get_input1()
    T = get_input2()

    count = 0
    for t in T:
        for s in S:
            if t == s:
                count += 1
                break

    print(count)


def get_input1():
    n = int(input())
    if n > 10000:
        print(ERROR_INPUT)
        sys.exit(1)

    li = []
    for x in input().split:
        if int(x) < 0 or int(x) > 10 ** 9:
            print(ERROR_INPUT)
            sys.exit(1)
        li.append(x)

    return li


def get_input2():
    n = int(input())
    if n > 500:
        print(ERROR_INPUT)
        sys.exit(1)

    li = []
    for x in input().split:
        if int(x) < 0 or int(x) > 10 ** 9:
            print(ERROR_INPUT)
            sys.exit(1)
        elif int(x) in li:
            print(ERROR_INPUT_NOT_UNIQUE)
            sys.exit(1)
        li.append(x)

    return li


main()

Fixed submission:
import sys

ERROR_INPUT = 'input is invalid'
ERROR_INPUT_NOT_UNIQUE = 'input is not unique'


def main():
    S = get_input1()
    T = get_input2()

    count = 0
    for t in T:
        if linner_search(S, t):
            count += 1

    print(count)


def linner_search(li, key):
    li.append(key)
    i = 0
    while li[i] != key:
        i += 1

    return i != len(li) - 1


def get_input1():
    n = int(input())
    if n > 10000:
        print(ERROR_INPUT)
        sys.exit(1)

    li = []
    for x in input().split(' '):
        if int(x) < 0 or int(x) > 10 ** 9:
            print(ERROR_INPUT)
            sys.exit(1)
        li.append(x)

    return li


def get_input2():
    n = int(input())
    if n > 500:
        print(ERROR_INPUT)
        sys.exit(1)

    li = []
    for x in input().split(' '):
        if int(x) < 0 or int(x) > 10 ** 9:
            print(ERROR_INPUT)
            sys.exit(1)
        elif int(x) in li:
            print(ERROR_INPUT_NOT_UNIQUE)
            sys.exit(1)
        li.append(x)

    return li


main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
    cards = []
    for _ in range(int(input())):
        cards.append(Card(input()))

    base_cards = cards.copy()
    quickSort(cards, 0, len(cards) - 1)

    print(check_stable(base_cards, cards))
    for c in cards:
        print(c.cha, c.num)


def quickSort(A, p, r):
    if p < r:
        q = partiton(A, p, r)
        quickSort(A, p, q - 1)
        quickSort(A, q + 1, r)


def partiton(A, p, r):
    x = A[r]
    i = p - 1

    for j in range(p, r):
        if A[j].num <= x.num:
            i = i + 1
            A[i], A[j] = A[j], A[i]

    A[i + 1], A[r] = A[r], A[i + 1]
    return i + 1


def check_stable(base, card):
    nums = []
    for c in card:
        if c.num not in nums:
            nums.append(c.num)

    for n in nums:
        if list(filter(lambda x: x.num == n, base)) != list(filter(lambda x: x.num == n, card)):
            return 'Not stable'

    return 'Stable'


class Card:
    def __init__(self, imp):
        cha, num = imp.split(' ')
        self.cha = cha
        self.num = int(num)


main()

Fixed submission:
"""Quick Sort."""
 
def partition(A, p, r):
    """Divide list A into A[p:q] whose elements aren't greater than A[q] and
    A[q+1:r] whose elements are greater than A[q].
 
    Each element of A is a list [x, y].
    x is a character of S, H, C or D (trump suits).
    y is a natural number.
    Sorting is done based on y numbers.
     
    Default value of p is 0.
    The number as a refernce of the division is A[r].
     
    Return the index q.
    """
 
    x = A[r][1]
    i = p - 1
    for j in range(p, r):
        if A[j][1] <= x:
            i += 1
            A[i], A[j] = A[j], A[i]
    A[i + 1], A[r] = A[r], A[i + 1]
    return i + 1
 
 
def quickSort(A, p, r):
    """Sort list A in ascending order with quick sort algorithm.
 
    Default value of p is 0 (the start index).
    r is 1 less than the length of A (the last index of A).
    """
 
    if p < r:
        q = partition(A, p, r)
        quickSort(A, p, q - 1)
        quickSort(A, q + 1, r)
 
 
def is_stable(A, B):
    """Check the stability of sorted list A.
 
    A is a sorted list.
    B is a original list.
 
    Return True or False.
    """
 
    cA = list(A)
    for x in B:
        i = cA.index(x)
        if i == 0:
            pass
        elif cA[i - 1][1] == x[1]:
            return False
        del cA[i]
    return True
 
 
 
import sys
 
r = int(sys.stdin.readline()) - 1
 
A = []
 
for x in sys.stdin.readlines():
    suit, num = x.split()
    num = int(num)
    A.append([suit, num])
 
B = list (A)
 
quickSort(A, 0, r)
 
if is_stable(A, B):
    print('Stable')
else:
    print('Not stable')
 
for x in A:
    print(*x)
Buggy python submission (verdict: Runtime Error):
z = input().split()
x = int(z[0])
y = int(z[1])

def gcd(x,y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)
print(gcd(x,y))

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

def insertionSort(a,n):
    for i in range(n):
        v = a[i]
        j = i - 1
        while j >= 0 and a[j] > v:
            a[j + 1] = a[j]
            j -= 1
        a[j + 1] = v 
        print(" ".join(map(str, a)))
        
insertionSort(a,n)
Buggy python submission (verdict: Runtime Error):
import math
l = input().split()
x1 = int(l[0])
y1 = int(l[1])
x2 = int(l[2])
y2 = int(l[3])

a = pow((x2 - x1), 2) + pow((y2 - y1), 2)
ans = math.sqrt(a)
print("{0:.8f}".format(ans))

Fixed submission:
import math
l = input().split()
x1 = float(l[0])
y1 = float(l[1])
x2 = float(l[2])
y2 = float(l[3])

a = pow((x2 - x1), 2) + pow((y2 - y1), 2)
ans = math.sqrt(a)
print(ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    for i in range(n):
        std = np.std(s)
    print("{0:.8f}".format(std))

Fixed submission:
import math
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    z = sum([(float(s[i])-m)**2 for i in range(n)])
    b = z / n
    print("{0:.8f}".format(math.sqrt(b)))

Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    for i in range(n):
        std = np.std(s)
    print("{0:.8f}".format(std))

Fixed submission:
import math
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    z = sum([(float(s[i])-m)**2 for i in range(n)])
    b = z / n
    print("{0:.8f}".format(math.sqrt(b)))

Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    for i in range(n):
        std = np.std(s)
    print("{0:.8f}".format(std), end="\n")
    

Fixed submission:
import math
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    z = sum([(float(s[i])-m)**2 for i in range(n)])
    b = z / n
    print("{0:.8f}".format(math.sqrt(b)))

Buggy python submission (verdict: Runtime Error):
import numpy as np
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    for i in range(n):
        std = np.std(s)
    print("{0:.8f}".format(std))
    

Fixed submission:
import math
while True:
    n = int(input())
    if n == 0:
        break

    s = list(map(int, input().split()))
    m = sum(s) / n
    z = sum([(float(s[i])-m)**2 for i in range(n)])
    b = z / n
    print("{0:.8f}".format(math.sqrt(b)))
Buggy python submission (verdict: Runtime Error):
import math
r = int(input())

print("{0:5f} {0:5f}".format(float(r * r * math.pi), float(r * 2 * math.pi)))

Fixed submission:
import math
r = float(input())

print("{0:5f} {1:5f}".format(float(r * r * math.pi), float(r * 2 * math.pi)))
Buggy python submission (verdict: Runtime Error):
a = []
while True:
    n = int(input())
    if n == 0:
        break
    a.append(n)

for i in range(len(a)):
    b = list(str(a[i]))
    sum = 0
    for j in b:
        sum += int(j)
    print(sum)))

Fixed submission:
a = []
while True:
    n = int(input())
    if n == 0:
        break
    a.append(n)

for i in range(len(a)):
    b = list(str(a[i]))
    sum = 0
    for j in b:
        sum += int(j)
    print(sum)
Buggy python submission (verdict: Runtime Error):
w = input().lower()
t = 0
while True:
    s = input().lower()
    if s == "END_OF_TEXT":
        break
    t += s.count(w)
print(t)

Fixed submission:
w = input().lower()
t = 0
while True:
    s = input()
    if s == "END_OF_TEXT":
        break
    t += s.lower().split().count(w)
print(t)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
Rt=[]
for i in range(n):
	Rt.append(int(input()))

a=-999999999
for i in range(n):
	for j in range(i+1,n):
		if a<Rt[j]-Rt[i]:
			a=Rt[j]-Rt[i]
		
print(a)


Fixed submission:
n=int(input())
Rt=[]
for i in range(n):
	Rt.append(int(input()))

maxv=Rt[1]-Rt[0]
minv=Rt[0]
for j in range(1,n):
	maxv=max(maxv,Rt[j]-minv)
	minv=min(minv,Rt[j])
		
print(maxv)

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
Rt=[]
for i in range(n):
	Rt.append(int(input()))

a=-999999999
for i in range(1,n):
	for j in range(i):
		if a<Rt[i]-Rt[j]:
			a=Rt[i]-Rt[j]
		
print(a)


Fixed submission:
n=int(input())
Rt=[]
for i in range(n):
	Rt.append(int(input()))

maxv=Rt[1]-Rt[0]
minv=Rt[0]
for j in range(1,n):
	maxv=max(maxv,Rt[j]-minv)
	minv=min(minv,Rt[j])
		
print(maxv)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
	flag=0
	for j in range(1,n):
                j=n-j
		if s[j]<s[j-1]:
			a=s[j]
			s[j]=s[j-1]
			s[j-1]=a
			m+=1
			flag=1

print(' '.join(s))
print(m)



Fixed submission:
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
    flag=0
    for j in range(1,n):
        j=n-j
        if int(s[j])<int(s[j-1]):
            a=s[j]
            s[j]=s[j-1]
            s[j-1]=a
            m+=1
            flag=1

print(' '.join(s))
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
	flag=0
	for j in range(1,n):
                j=n-j
		if s[j]<s[j-1]:
			a=s[j]
			s[j]=s[j-1]
			s[j-1]=a
			m+=1
			flag=1

print(' '.join(s))
print(m)



Fixed submission:
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
    flag=0
    for j in range(1,n):
        j=n-j
        if int(s[j])<int(s[j-1]):
            a=s[j]
            s[j]=s[j-1]
            s[j-1]=a
            m+=1
            flag=1

print(' '.join(s))
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
　　　　flag=0
　　　　for j in range(1,n):
　　　　　　　　j=n-j
　　　　　　　　if s[j]<s[j-1]:
　　　　　　　　　　　　a=s[j]
　　　　　　　　　　　　s[j]=s[j-1]
　　　　　　　　　　　　s[j-1]=a
　　　　　　　　　　　　m+=1
　　　　　　　　　　　　flag=1
　　　　　　　　　　　　print(j)

print(' '.join(s))
print(m)


Fixed submission:
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
    flag=0
    for j in range(1,n):
        j=n-j
        if int(s[j])<int(s[j-1]):
            a=s[j]
            s[j]=s[j-1]
            s[j-1]=a
            m+=1
            flag=1

print(' '.join(s))
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
　　　　flag=0
　　　　for j in range(1,n):
　　　　　　　　j=n-j
　　　　　　　　if s[j]<s[j-1]:
　　　　　　　　　　　　a=s[j]
　　　　　　　　　　　　s[j]=s[j-1]
　　　　　　　　　　　　s[j-1]=a
　　　　　　　　　　　　m+=1
　　　　　　　　　　　　flag=1
　　　　　　　　　　　　print(j)

print(' '.join(s))
print(m)


Fixed submission:
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
    flag=0
    for j in range(1,n):
        j=n-j
        if int(s[j])<int(s[j-1]):
            a=s[j]
            s[j]=s[j-1]
            s[j-1]=a
            m+=1
            flag=1

print(' '.join(s))
print(m)

Buggy python submission (verdict: Runtime Error):
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
　　　　flag=0
　　　　for j in range(1,n):
　　　　　　　　j=n-j
　　　　　　　　if s[j]<s[j-1]:
　　　　　　　　　　　　a=s[j]
　　　　　　　　　　　　s[j]=s[j-1]
　　　　　　　　　　　　s[j-1]=a
　　　　　　　　　　　　m+=1
　　　　　　　　　　　　flag=1

print(' '.join(s))
print(m)


Fixed submission:
n=int(input())
s=input().split(' ')

flag=1
m=0

while flag:
    flag=0
    for j in range(1,n):
        j=n-j
        if int(s[j])<int(s[j-1]):
            a=s[j]
            s[j]=s[j-1]
            s[j-1]=a
            m+=1
            flag=1

print(' '.join(s))
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
que = []

for i in range(n):
    lineArr = input().split()
    ope = lineArr[0]

    if ope == 'insert':
        num = int(lineArr[1])
        que.insert(0, num)
    elif ope == 'delete':
        num = int(lineArr[1])
        try:
            que.remove(num)
        except ValueError:
            pass
    elif ope == 'deleteFirst':
        que.pop(0)
    else:
        que.pop()

print(*que)



Fixed submission:
import collections

n = int(input())
que = collections.deque()

for i in range(n):
    line = input()

    if line[0] == 'i':
        que.appendleft(int(line[7:]))
    elif line[6] == ' ':
        try:
            que.remove(int(line[7:]))
        except ValueError:
            pass
    elif line[6] == 'F':
        que.popleft()
    else:
        que.pop()

print(*que)

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

n = int(input())
que = collections.deque()

for i in range(n):
    lineArr = input().split()
    ope = lineArr[0]

    if ope == 'insert':
        num = int(lineArr[1])
        que.insert(0, num)
    elif ope == 'delete':
        num = int(lineArr[1])
        try:
            que.remove(num)
        except ValueError:
            pass
    elif ope == 'deleteFirst':
        que.popleft()
    else:
        que.pop()

print(*que)



Fixed submission:
import collections

n = int(input())
que = collections.deque()

for i in range(n):
    line = input()

    if line[0] == 'i':
        que.appendleft(int(line[7:]))
    elif line[6] == ' ':
        try:
            que.remove(int(line[7:]))
        except ValueError:
            pass
    elif line[6] == 'F':
        que.popleft()
    else:
        que.pop()

print(*que)

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

n = int(input())
que = collections.deque()

for i in range(n):
    lineArr = input().split()
    ope = lineArr[0]

    if ope == 'insert':
        num = int(lineArr[1])
        que.appendleft(num)
    elif ope == 'delete':
        num = int(lineArr[1])
        try:
            que.remove(num)
        except ValueError:
            pass
    elif ope == 'deleteFirst':
        que.popleft()
    else:
        que.pop()

print(*que)



Fixed submission:
import collections

n = int(input())
que = collections.deque()

for i in range(n):
    line = input()

    if line[0] == 'i':
        que.appendleft(int(line[7:]))
    elif line[6] == ' ':
        try:
            que.remove(int(line[7:]))
        except ValueError:
            pass
    elif line[6] == 'F':
        que.popleft()
    else:
        que.pop()

print(*que)
Buggy python submission (verdict: Runtime Error):
import math

x1, y1, x2, y2 = map(int, input().split())

print("{a:5f}".format(a=math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))))



Fixed submission:
import math

x1, y1, x2, y2 = map(float, input().split())

print(math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2)))

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

x1, y1, x2, y2 = map(int, input().split())

print("{a:5f}".format(
    a=math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2))))



Fixed submission:
import math

x1, y1, x2, y2 = map(float, input().split())

print(math.sqrt(math.pow(x2 - x1, 2) + math.pow(y2 - y1, 2)))
Buggy python submission (verdict: Time Limit Exceeded):
dice = list(map(int, input().split()))
mask = {
    'N': (1, 5, 2, 3, 0, 4),
    'R': (0, 2, 4, 1, 3, 5)
    }

for i in range(int(input())):
    a, b = map(int, input().split())

    while dice[0] != a:
        dice = [dice[x] for x in mask['N']]
    while dice[1] != b:
        dice = [dice[x] for x in mask['R']]
    print(dice[2])



Fixed submission:
dice = list(map(int, input().split()))
mask = {
    'N': (1, 5, 2, 3, 0, 4),
    'R': (0, 2, 4, 1, 3, 5)
    }


for i in range(int(input())):
    a, b = map(int, input().split())

    lim = 0
    while dice[0] != a:
        dice = [dice[x] for x in mask['N']]
        lim += 1
        if lim == 4:
            dice = [dice[x] for x in mask['R']]
            lim = 0
    while dice[1] != b:
        dice = [dice[x] for x in mask['R']]
    print(dice[2])