Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
nums = []

for i in range(N):
    nums.append(int(raw_input()))

m = -100000000000000000

for i in range(len(nums)):
    for j in range(0, i):
        if m < nums[i] - nums[j]:
            m = nums[i] - nums[j]

print(m)

Fixed submission:
N = int(raw_input())
nums = []

for i in range(N):
    nums.append(int(raw_input()))

m = -1000000000000000000000000
minvalue = nums[0]

for i in range(1, len(nums)):
    minvalue = min(minvalue, nums[i-1])
    value = nums[i] - minvalue
    if m <= value:
        m = value

print(m)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(raw_input())
nums = []

for i in range(N):
    nums.append(int(raw_input()))

m = -1000000000000000000000000
for i in range(1, len(nums)):
    value = nums[i] - min(nums[:i])
    if m <= value:
        m = value

print(m)

Fixed submission:
N = int(raw_input())
nums = []

for i in range(N):
    nums.append(int(raw_input()))

m = -1000000000000000000000000
minvalue = nums[0]

for i in range(1, len(nums)):
    minvalue = min(minvalue, nums[i-1])
    value = nums[i] - minvalue
    if m <= value:
        m = value

print(m)
Buggy python submission (verdict: Runtime Error):
import math
x1, y1, x2, y2 = map(int, raw_input().split(" "))
print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2))

Fixed submission:
import math
x1, y1, x2, y2 = map(float, raw_input().split(" "))
print(math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2))
Buggy python submission (verdict: Time Limit Exceeded):
def search(nmax, n, x):
    if n > nmax: return 0
    if x < 0: return 0
    if x == 0: return 1
    return search(nmax, n+1, x) + search(nmax, n+1, x-n)

while 1:
    n, x = map(int, raw_input().split())
    if n == 0 and x == 0: break

    num = search(n, 0, x)
    print(num)

Fixed submission:
while 1:
    n, x = map(int, raw_input().split())
    if n == 0 and x == 0: break

    count = 0
    for i in range(1, n+1):
        for j in range(i+1, n+1):
            for k in range(j+1, n+1):
                if i + j + k == x:
                    count += 1

    print(count)
Buggy python submission (verdict: Runtime Error):
while 1:
    input = raw_input()
    output = ""

    for i in input:
        if i.islower():
            output += i.upper()
        elif i.isupper():
            output += i.lower()
    
    print(output)

Fixed submission:
print raw_input().swapcase()
Buggy python submission (verdict: Runtime Error):
while 1:
    input = raw_input()
    num = len(input)
    input = int(input)

    count = 0
    for i in range(num, 0, -1):
        value = int(input / 10**(i-1))
        input -= value * 10 ** (i-1)
        count += value

    print(count)

Fixed submission:
while 1:
    input = raw_input()
    num = len(input)
    input = int(input)
    
    if input == 0:
        break
        
    count = 0
    for i in range(num, 0, -1):
        value = int(input / 10**(i-1))
        input -= value * 10 ** (i-1)
        count += value

    print(count)
Buggy python submission (verdict: Runtime Error):
def check(s, p):
    count = 0
    for i in range(len(s)):
        for j in range(len(p)):
            if s[(i+j) % len(s)] != p[j]:
                break
            count += 1
        if count == len(p):
            return True
    return False

s, p = raw_input()
flag = check(s, p)
if flag:
    print("Yes")
else:
    print("No")

Fixed submission:
def check(s, p):
    for i in range(len(s)):
        count = 0
        for j in range(len(p)):
            if s[(i+j) % len(s)] != p[j]:
                break
            count += 1
        if count == len(p):
            return True
    return False

s = raw_input()
p = raw_input()
flag = check(s, p)
if flag:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
s = raw_input()
n = int(raw_input())

for i in range(n):
    message = raw_input().split(" ")
    a, b = int(message[1]), int(message[2])

    if message[0] == "print":
        print(s[a:b+1])
    elif message[0] == "reverse":
        s[a:b+1] = s[a:b+1][::-1]
    elif message[0] == "replace":
        s = s[:a] + message[3] + s[b:]

Fixed submission:
s = raw_input()
n = int(raw_input())

for i in range(n):
    message = raw_input().split(" ")
    a, b = int(message[1]), int(message[2])

    if message[0] == "print":
        print(s[a:b+1])
    elif message[0] == "reverse":
        s = s[:a] + s[a:b+1][::-1] + s[b+1:]
    elif message[0] == "replace":
        s = s[:a] + message[3] + s[b+1:]
Buggy python submission (verdict: Runtime Error):
,b= input().split()

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

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

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

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

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

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

if(a==b):
	print("a == b")
elif(a<b):
	print("a < b")
elif(a>b):
	print("a > b")
Buggy python submission (verdict: Runtime Error):
W,H,x,y,r= map(int,input().split())
if(x-r<0 || x+r>W || y-r<0 || y+r>H):
	print("No")
else:
	print("Yes")

Fixed submission:
W,H,x,y,r= map(int,input().split())
if(x-r<0 or x+r>W or y-r<0 or y+r>H):
	print("No")
else:
	print("Yes")
Buggy python submission (verdict: Runtime Error):
r= int(input())
??= 3.141592653589793238
print(??*r**2,2*??*r)

Fixed submission:
from math import pi
r = float(input())
print(round(r * r * pi, 7), round(2 * pi * r, 7))

Buggy python submission (verdict: Runtime Error):
r= int(input())
p= 3.141592653589793238
print(p*r**2,2*p*r)

Fixed submission:
from math import pi
r = float(input())
print(round(r * r * pi, 7), round(2 * pi * r, 7))

Buggy python submission (verdict: Runtime Error):
r= int(input())
p= 3.141592
print(p*r**2,2*p*r)

Fixed submission:
from math import pi
r = float(input())
print(round(r * r * pi, 7), round(2 * pi * r, 7))

Buggy python submission (verdict: Runtime Error):
r= float(input())
??= 3.141592653589793238
print(??*r**2,2*??*r)

Fixed submission:
from math import pi
r = float(input())
print(round(r * r * pi, 7), round(2 * pi * r, 7))
Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
a.sort()

cd = a[0]

while a[0]%cd != 0 or a[1]%cd != 0:
    cd -= 1

print(cd)

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

while a[0] > 0:
    b = a[1]%a[0]
    a[1] = a[0]
    a[0] = b
    
print(a[1])

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
a.sort()

cd = a[0]

while a[0]%cd != 0 or a[1]%a[0]%cd != 0:
    cd -= 1

print(cd)

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

while a[0] > 0:
    b = a[1]%a[0]
    a[1] = a[0]
    a[0] = b
    
print(a[1])

Buggy python submission (verdict: Time Limit Exceeded):
a = list(map(int, input().split()))
a.sort()

cd = a[0]
b = a[1]%a[0]

while a[0]%cd != 0 or b%cd != 0:
    cd -= 1

print(cd)

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

while a[0] > 0:
    b = a[1]%a[0]
    a[1] = a[0]
    a[0] = b
    
print(a[1])
Buggy python submission (verdict: Time Limit Exceeded):
import math

p = 0
n = int(input())

for i in range(n):
    a = int(input())
    
    if a == 2:
        p += 1
    elif a%2 == 0:
        pass
    else:
        d = int(math.sqrt(a))
        i = 3
        while i < d:
            if a%i == 0:
                break
        p += 1

print(p)

Fixed submission:
import math

def prime(x):
    if x == 2:
        return True
    elif x%2 == 0:
        return False
    else:
        i = 3
        while i <= math.sqrt(x):
           if x%i == 0:
                return False
           else:
                i += 2
        return True

        
        

p = 0
n = int(input())

for i in range(n):
    if prime(int(input())) == True:
        p += 1
        

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

while True:
    n = input()
    score = list(map(float, input().split()))
    
    if n == "0":
        break
    else:
        m = sum(score)/len(score)
        for i in range(len(score)):
            score[i] = (score[i]-m)**2
    answer = math.sqrt(sum(score)/len(socre))
    print(answer)

Fixed submission:
import math

while True:
    n = input()
    
    if n == "0":
        break
    else:
        score = list(map(float, input().split()))
        m = sum(score)/len(score)
        for i in range(len(score)):
            score[i] = (score[i]-m)**2
    answer = math.sqrt(sum(score)/len(score))
    print(answer)

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

while True:
    n = input()
    
    if n == "0":
        break
    else:
        score = list(map(float, input().split()))
        m = sum(score)/len(score)
        for i in range(len(score)):
            score[i] = (score[i]-m)**2
    answer = math.sqrt(sum(score)/len(socre))
    print(answer)

Fixed submission:
import math

while True:
    n = input()
    
    if n == "0":
        break
    else:
        score = list(map(float, input().split()))
        m = sum(score)/len(score)
        for i in range(len(score)):
            score[i] = (score[i]-m)**2
    answer = math.sqrt(sum(score)/len(score))
    print(answer)
Buggy python submission (verdict: Runtime Error):
x = input()
print (x**3)

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

Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])
print(a*b, a*2+b*2)

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

Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])
print(a*b, a*2+b*2)
Buggy python submission (verdict: Runtime Error):
l = input().split()
l = list(map(int, l))

if l[0] < l[1] and l[1] < l[2]:
    print("Yes")

else:
    print("No")

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

if l[0] < l[1] and l[1] < l[2]:
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Runtime Error):
l = input().split()
l = list(map(int, l))

if l[2]-l[4] >=0 and l[3]-l[4] >=0 and l[2]+l[4] <=l[0] and l[3]+l[4] <=l[1]:
    print("Yes")
else:
    print("No")

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

if l[2]-l[4] >=0 and l[3]-l[4] >=0 and l[2]+l[4] <=l[0] and l[3]+l[4] <=l[1]:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
n=0
cases=[0]

while n<=9999:
    case=input()
    if int(case) != 0:
        cases.append(case)
        n+=1
    else:
        break

length=len(cases)

for n in range(length):
    print("Case "+str(n+1)+": "+str(cases[n+1]))

Fixed submission:
index=1

while True:
    case=input()
    if int(case)==0:
        break
    else:
        print("Case "+str(index)+": "+case)
        index+=1

Buggy python submission (verdict: Runtime Error):
cases=[]
while True:
    n = input()
    if n==0:
        break
    cases.append(n)

length=len(cases)

for n in range(length):
    print("Case "+str(n+1)+": "+str(cases[n]))

Fixed submission:
index=1

while True:
    case=input()
    if int(case)==0:
        break
    else:
        print("Case "+str(index)+": "+case)
        index+=1
Buggy python submission (verdict: Runtime Error):
while True:
    case=input().split()
    int(case[0])
    int(case[1])
    
    if case[0]==0 and case[1]==0: 
        break
    else:
        case.sort()
        print(case[0],case[1])

Fixed submission:
while True:
    case=input().split()
    x=int(case[0])
    y=int(case[1])
    
    if x==0 and y==0:
        break
    else:
        if x<y:
            print(x,y)
        else:
            print(y,x)
Buggy python submission (verdict: Runtime Error):
import math

r = int(input())
a = math.pi*r*r
l = 2*math.pi*r

print("{:.6f}".format(a),"{:.6f}".format(l))

Fixed submission:
import math

r = float(input())
a = math.pi*r*r
l = 2*math.pi*r

print("{:.6f}".format(a),"{:.6f}".format(l))
Buggy python submission (verdict: Runtime Error):
import sys

while True:
    
    ins = input().split()
    h = int(ins[0])
    w = int(ins[1])

    if h == 0 and w == 0:
        break
        
    for i in range(h):
        for j in range(w-1):
            sys.stdout.write("#")
        print("#")
        
    print("")

Fixed submission:
import sys

while True:
    
    ins = input().split()
    h = int(ins[0])
    w = int(ins[1])

    if h == 0 and w == 0:
        break
        
    for i in range(h):
        for j in range(w-1):
            sys.stdout.write("#")
        print("#")
        
    print("")
Buggy python submission (verdict: Runtime Error):
while True:
    
    l = input().split()
    h = int(l[0])
    w = int(l[1])

    if h == 0 and w ==0:
        break
    
    flag = 0

    for i in range(h*(w+1)):
        if (i+1) % (w+1) == 0:
            print("")
            if w % 2 == 0:
                flag += 1
            if i == h*(w+1)-1:
                print("")


        else:
            if flag % 2 == 0:
             print("#", end="")
             flag += 1
            else:
             print(".", end="")
             flag += 1

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

for i in range(n):
    if i == n-1:
        print(given_list[n-i-1])
    else:
        print(given_list[n-i-1], end=" ")
Buggy python submission (verdict: Time Limit Exceeded):
N = input()
nums = []
for i in range(N):
     nums.append(input())

profit = nums[1] - nums[0]
for a in range(N):
     for b in range(a):
          if (nums[a] - nums[b]) > profit:
               profit = nums[a] - nums[b]

print profit

Fixed submission:
N = input()
nums = []
for i in range(N):
     nums.append(input())
profit = nums[1] - nums[0]
min = nums[0]
for a in range(1, N):
     if nums[a] - min > profit:
          profit = nums[a] - min

     if nums[a] < min:
               min = nums[a]
print profit
Buggy python submission (verdict: Runtime Error):
a = raw_input()

print(a*a*a)

Fixed submission:
a = input()

print(a*a*a)
Buggy python submission (verdict: Runtime Error):
l = map(int,raw_input().split())

print(l[0]*l[1])
print(" ")
print(l[0]*2+[1]*2)

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

print(str(l[0]*l[1])+" "+str((l[0]+l[1])*2))
Buggy python submission (verdict: Runtime Error):
S=input()

h=S/3600
S=S-h*3600
m=S/60
s=S-m*60

return str(h)+":"+str(m)+":"+str(s)

Fixed submission:
S=input()

h=S/3600
S=S-h*3600
m=S/60
s=S-m*60
print str(h)+":"+str(m)+":"+str(s)
Buggy python submission (verdict: Runtime Error):
l = map(int, raw_input().split())
if l[0] > l[1]:
    print str(l[0])+" > "+str(l[1])
elif l[0] == l[1]:
    print str(l[0])+" == "+str(l[1])
else
    print str(l[0])+" < "+str(l[1])

Fixed submission:
l = map(int, raw_input().split())
if l[0]>l[1]:
    print "a > b"
elif l[0]==l[1]:
    print "a == b"
else:
    print "a < b"

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

Fixed submission:
l = map(int, raw_input().split())
if l[0]>l[1]:
    print "a > b"
elif l[0]==l[1]:
    print "a == b"
else:
    print "a < b"

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

Fixed submission:
l = map(int, raw_input().split())
if l[0]>l[1]:
    print "a > b"
elif l[0]==l[1]:
    print "a == b"
else:
    print "a < b"

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

Fixed submission:
l = map(int, raw_input().split())
if l[0]>l[1]:
    print "a > b"
elif l[0]==l[1]:
    print "a == b"
else:
    print "a < b"
Buggy python submission (verdict: Runtime Error):
W,H,x,y,r=map(int,input().split())
x+r<W&&r<x&&r<y&&y+r<H?print "Yes":print "No"

Fixed submission:
W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r=map(int,input().split())
print x+r<W&&r<x&&r<y&&y+r<H?"Yes":"No"

Fixed submission:
W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")

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

Fixed submission:
W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")

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

Fixed submission:
W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")

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

Fixed submission:
W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")

Buggy python submission (verdict: Runtime Error):
W,H,x,y,r=map(int,input().split())
if !(x+r>W or r>x or r>y or y+r>H):
 print("Yes")
else :
 print("No")

Fixed submission:
W,H,x,y,r=map(int,input().split())
if not (x+r>W or r>x or r>y or y+r>H):print("Yes")
else:print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
#print(N)
card = list(map(int, input().split()))
#print(card)

for i in range(N):
    v = card[i]
    j = i - 1
    while j >= 0 and card[j] > v:
        card[j+1] = card[j]
        j = j -1
    card[j+1] = v
    #print(card)
    card_str = ""
    
    for k in range(N-1):
        card_str += str(card[k])
        card_str += " "
    card_str += str(card[k+1])
    print(card_str)

Fixed submission:
N = int(input())
#print(N)
card = list(map(int, input().split()))
#print(card)

for i in range(N):
    v = card[i]
    j = i - 1
    while j >= 0 and card[j] > v:
        card[j+1] = card[j]
        j = j -1
    card[j+1] = v
    #print(card)
    card_str = ""
    
    for k in range(N):
        card_str += str(card[k])
        card_str += " "
    
    print(card_str[:-1])
Buggy python submission (verdict: Time Limit Exceeded):
num = int(input())
num_list = [int(input()) for x in range(num)]
max_difference = float("-inf")

for i in range(num):
    for j in range(i+1, num):
        difference = num_list[j] - num_list[i]
        if max_difference < difference:
            max_difference = difference

print(max_difference)

Fixed submission:

num = int(input())
max_value = float("-inf")
min_value = float("inf")

for i in [int(input()) for x in range(num)]:

    if max_value < (i - min_value):
        max_value = i - min_value

    if min_value > i:
        min_value = i

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


def greatest_common_divisor(x, y):
    x_divisor = {i for i in range(1, x+1) if x % i == 0}
    y_divisor = {i for i in range(1, y+1) if y % i == 0}
    common_divisor = list(x_divisor.intersection(y_divisor))
    common_divisor.sort()
    print(common_divisor.pop(-1))


def to_xy(v):
    return [int(c) for c in v.split()]


if __name__ == '__main__':
    x, y = to_xy(input())
    greatest_common_divisor(x, y)

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


def gcd(x, y):
    # GCD(Greatest Common Divisor)
    if x < y:
        x, y = y, x

    while y > 0:
        r = x % y
        x = y
        y = r

    print(x)


def to_xy(v):
    return [int(c) for c in v.split()]


if __name__ == '__main__':
    x, y = to_xy(input())
    gcd(x, y)
Buggy python submission (verdict: Time Limit Exceeded):
# -*- coding: utf-8 -*-


def maximum_profit(profits):
    max_v = profits[1] - profits[0]

    for j in range(1, len(profits)):
        for i in range(0, j):
            max_v = max(profits[j] - profits[i], max_v)

    print(max_v)


def to_int(v):
    return int(v)


if __name__ == '__main__':
    l = to_int(input())
    profits = [to_int(input()) for i in range(l)]

    maximum_profit(profits)

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


def maximum_profit(profits):
    max_v = profits[1] - profits[0]
    min_v = profits[0]

    for j in range(1, len(profits)):
        max_v = max(max_v, profits[j]-min_v)
        min_v = min(min_v, profits[j])

    print(max_v)


def to_int(v):
    return int(v)


if __name__ == '__main__':
    l = to_int(input())
    profits = [to_int(input()) for i in range(l)]

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


def bubble_sort(cards, num):
  for left in range(num-1):
        for right in range(left+1, num):
            if cards[right][1] < cards[left][1]:
                cards[left], cards[right] = cards[right], cards[left]

    print(list_to_str(cards))


def selection_sort(cards, num):
    for head in range(num):
        min_i = head

        for target in range(head+1, num):
            if cards[target][1] < cards[min_i][1]:
                min_i = target
        cards[head], cards[min_i] = cards[min_i], cards[head]

    print(list_to_str(cards))


def is_stable(before, after, num):
    for i in range(num):
        for j in range(i+1, num):
            for a in range(num):
                for b in range(a+1, num):
                    if before[i][1] == before[j][1]\
                    and before[i] == after[b]\
                    and before[j] == after[a]:
                        return 'Not stable'
    return 'Stable'


def list_to_str(l, delimiter=' '):
    # The default delimiter is one space.
    return delimiter.join([str(v) for v in l])


if __name__ == '__main__':
    num = int(input())
    cards = input().split()
    cards_for_bubble = cards.copy()
    cards_for_selection = cards.copy()

    bubble_sort(cards_for_bubble, num)
    print(is_stable(cards, cards_for_bubble, num))

    selection_sort(cards_for_selection, num)
    print(is_stable(cards, cards_for_selection, num))

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


def bubble_sort(cards, num):
    for tail in range(num-1, 0, -1):
        for right in range(0, tail):
            left = right + 1
            if cards[left][1] < cards[right][1]:
                cards[right], cards[left] = cards[left], cards[right]

    print(list_to_str(cards))


def selection_sort(cards, num):
    for head in range(num):
        min_i = head

        for target in range(head+1, num):
            if cards[target][1] < cards[min_i][1]:
                min_i = target
        cards[head], cards[min_i] = cards[min_i], cards[head]

    print(list_to_str(cards))


def is_stable(before, after, num):
    for i in range(num):
        for j in range(i+1, num):
            for a in range(num):
                for b in range(a+1, num):
                    if before[i][1] == before[j][1]\
                    and before[i] == after[b]\
                    and before[j] == after[a]:
                        return 'Not stable'
    return 'Stable'


def list_to_str(l, delimiter=' '):
    # The default delimiter is one space.
    return delimiter.join([str(v) for v in l])


if __name__ == '__main__':
    num = int(input())
    cards = input().split()
    cards_for_bubble = cards.copy()
    cards_for_selection = cards.copy()

    bubble_sort(cards_for_bubble, num)
    print(is_stable(cards, cards_for_bubble, num))

    selection_sort(cards_for_selection, num)
    print(is_stable(cards, cards_for_selection, num))
Buggy python submission (verdict: Runtime Error):
a=int(input("a:"))
b=int(input("b:"))


# a=max(a, b)
# b=min(a, b)?????¨??????????????????????????????
# ???????????????????????????a1=30, b1=100??????a2=b1=100, b2=r1=30??¨???????????§?°???\???????????????


while True:
    r=a%b
    if r==0:
        break
    else:
        a=b
        b=r
print(b)

Fixed submission:

a,b = map(int,input().split())
while True:
    r=a%b
    if r==0:
        break
    else:
        a=b
        b=r
print(b)