Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n = "keyence"
s = input()
cnt = 0


for i in s:
    if n[0] == i:
        n = n[1:]
        if cnt > 0:
            cnt = -1
    elif n[0] != i:
        if cnt == -1:
            break
        cnt += 1

if n == "":
    print("YES")
else:
    print("NO")

Fixed submission:
n = "keyence"
s = input()

for i in s:
    if n[0] == i: #文字が一致するなら
        n = n[1:] #比較中の文字を削る
    else:
        break

n = n[::-1]

for i in s[::-1]:
    if n == "":
        break
    elif n[0] == i:
        n = n[1:]
    else:
        break

if n == "":
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
import math

n, x = map(int, input().split())
xl = list(map(int, input().split()))
l = []

for i in xl:
    l.append(abs(i - x))

ans = l[0]

for i in l:
    ans = math.gcd(ans, i)

print(ans)

Fixed submission:
import fractions

n, x = map(int, input().split())
xl = list(map(int, input().split()))
l = []

for i in xl:
    l.append(abs(i - x))

ans = l[0]

for i in l:
    ans = fractions.gcd(ans, i)

print(ans)
Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = []
delrow = []
delcol = []


for i in range(h):
    a.append(list(input()))

for i in range(h):
    if set(a[i]) == {"."}:
        delrow.append(i)

for i in range(w):
    if set(a[0:w][i]) == {"."}:
        delcol.append(i)
        
for i in delrow [::-1]: #行を削除
    del a[i]
for i in delcol [::-1]: #列を削除
    for j in range(len(a)):
        del a[j][i]

for i in range(len(a)):
    print(*a[i], sep="")

Fixed submission:
h, w = map(int, input().split())
a = []
delrow = []
delcol = []
cnt = 0

for i in range(h):
    a.append(list(input()))

for i in range(h):
    for j in range(w):
        if a[i][j] != ".":
            break
        else:
            cnt += 1
        if cnt == w:
            delrow.append(i)
    cnt = 0

for i in range(w):
    for j in range(h):
        if a[j][i] != ".":
            break
        else:
            cnt += 1
        if cnt == h:
            delcol.append(i)
    cnt = 0

for i in delrow [::-1]: #行を削除
    del a[i]
for i in delcol [::-1]: #列を削除
    for j in range(len(a)):
        del a[j][i]

for i in range(len(a)):
    print(*a[i], sep="")

Buggy python submission (verdict: Runtime Error):
h, w = map(int, input().split())
a = []
delrow = []
delcol = []


for i in range(h):
    a.append(list(input()))

for i in range(h):
    print(set(a[i]))
    if set(a[i]) == {"."}:
        delrow.append(i)

for i in range(w):
    print(set(a[0:w][i]))
    if set(a[0:w][i]) == {"."}:
        delcol.append(i)
        
for i in delrow [::-1]: #行を削除
    del a[i]
for i in delcol [::-1]: #列を削除
    for j in range(len(a)):
        del a[j][i]

for i in range(len(a)):
    print(*a[i], sep="")

Fixed submission:
h, w = map(int, input().split())
a = []
delrow = []
delcol = []
cnt = 0

for i in range(h):
    a.append(list(input()))

for i in range(h):
    for j in range(w):
        if a[i][j] != ".":
            break
        else:
            cnt += 1
        if cnt == w:
            delrow.append(i)
    cnt = 0

for i in range(w):
    for j in range(h):
        if a[j][i] != ".":
            break
        else:
            cnt += 1
        if cnt == h:
            delcol.append(i)
    cnt = 0

for i in delrow [::-1]: #行を削除
    del a[i]
for i in delcol [::-1]: #列を削除
    for j in range(len(a)):
        del a[j][i]

for i in range(len(a)):
    print(*a[i], sep="")
Buggy python submission (verdict: Runtime Error):
n = int(input())
cnt = 0
ans = 0

for i in range(105, n + 1, 2):
    for j in range(1, n + 1):
        if i%j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
    cnt = 0
print(ans

Fixed submission:
n = int(input())
cnt = 0
ans = 0

for i in range(105, n + 1, 2):
    for j in range(1, n + 1):
        if i%j == 0:
            cnt += 1
    if cnt == 8:
        ans += 1
    cnt = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
x = int(input())
ans = []

for i in range(2, 100):
    n = 2
    while i**n <= x:
        ans.append(i**n)
        n += 1

print(max(ans))

Fixed submission:
x = int(input())
ans = 0


for i in range(1, 100):
    if i**2 > x:
        ans = (i - 1)**2
        break

for i in range(1, 100):
    if i**3 > x:
        ans = max(ans, (i - 1)**3)
        break

for i in range(1, 100):
    if i**5 > x:
        ans = max(ans, (i - 1)**5)
        break

for i in range(1, 100):
    if i**7 > x:
        ans = max(ans, (i - 1)**7)
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
s = input()
k = int(input())
l = "abcdefghijklmnopqrstuvwxyz"
d = {}

for i in range(26):
    cnt = s.count(l[i])
    pre = 0
    if cnt > 0:
        for j in range(cnt):
            pos = s.find(l[i], pre)
            pre = pos + 1
            for m in range(len(s) - pos):
                if s[pos:pos + m + 1] not in d:
                    d[s[pos:pos + m + 1]] = 1
    if len(d) >= k:
        dl = []
        for i in d.keys():
            dl.append(i)
        dl.sort()
        print(dl[k - 1])
        exit()

Fixed submission:
s = input()
k = int(input())
l = "abcdefghijklmnopqrstuvwxyz"
d = {}

for i in range(26):
    cnt = s.count(l[i])
    pre = 0
    if cnt > 0:
        for j in range(cnt):
            pos = s.find(l[i], pre)
            pre = pos + 1
            for m in range(min(len(s) - pos, k)):
                if s[pos:pos + m + 1] not in d:
                    d[s[pos:pos + m + 1]] = 1
    if len(d) >= k:
        dl = []
        for i in d.keys():
            dl.append(i)
        dl.sort()
        print(dl[k - 1])
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
n, y = map(int, input().split())

for i in range(y//10000 + 1):
    for j in range(y//5000 + 1):
        if 10000*i + 5000*j + 1000*(n - i - j) == y:
            if n - i - j >= 0:
                print(i, j, n - i - j)
                exit()

print(-1, -1, -1)

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

for i in range(y//10000 + 1):
    for j in range(y//5000 + 1):
        if 10000*i + 5000*j + 1000*(n - i - j) == y:
            if n - i - j >= 0:
                print(i, j, n - i - j)
                exit()

print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
s = input()

for i in range(0, 9, 2):
    if i == 8 and len(s) <= 8:
        s = s[:i] + "A" + s[i:]
    elif i != 2:
        if s[i] != "A":
            s = s[:i] + "A" + s[i:]
if s == "AKIHABARA":
    print("YES")
else:
    print("NO")

Fixed submission:
s = input()

if len(s) < 5:
    print("NO")
    exit()

for i in range(0, 9, 2):
    if i == 8 and len(s) <= 8:
        s = s[:i] + "A" + s[i:]
    elif i != 2:
        if s[i] != "A":
            s = s[:i] + "A" + s[i:]
if s == "AKIHABARA":
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0

    for i in set(a):
        cnt = 0
        for j in a:
            if j - 1 <= i <= j + 1:
                cnt += 1
        ans = max(ans, cnt)

    print(ans)

main()

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    l = [0]*(10**5 + 10)


    for i in a:
        l[i] += 1
        l[i + 1] += 1
        if i != 0:
            l[i - 1] += 1
    print(max(l))

main()

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    ans = 0

    for i in set(a):
        cnt = 0
        for j in a:
            if j - 1 <= i <= j + 1:
                cnt += 1
        ans = max(ans, cnt)

    print(ans)

main()

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    l = [0]*(10**5 + 10)


    for i in a:
        l[i] += 1
        l[i + 1] += 1
        if i != 0:
            l[i - 1] += 1
    print(max(l))

main()

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

for i in set(a):
    cnt = 0
    for j in a:
        if j - 1 <= i <= j + 1:
            cnt += 1
    ans = max(ans, cnt)

print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    l = [0]*(10**5 + 10)


    for i in a:
        l[i] += 1
        l[i + 1] += 1
        if i != 0:
            l[i - 1] += 1
    print(max(l))

main()

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

for i in a:
    cnt = 0
    for j in a:
        if j - 1 <= i <= j + 1:
            cnt += 1
    ans = max(ans, cnt)

print(ans)

Fixed submission:
import sys
input = sys.stdin.readline

def main():
    n = int(input())
    a = list(map(int, input().split()))
    l = [0]*(10**5 + 10)


    for i in a:
        l[i] += 1
        l[i + 1] += 1
        if i != 0:
            l[i - 1] += 1
    print(max(l))

main()
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
dist = 10**9


for i, j in ab:
    for k in range(n):
        dist1 = abs(i - cd[k][0]) + abs(j - cd[k][1])
        if dist1 < dist:
            dist = dist1
            ch = k + 1
    print(ch)
    dist = 10**9

Fixed submission:
n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]
cd = [list(map(int, input().split())) for _ in range(m)]
dist = 10**9


for i, j in ab:
    for k in range(m):
        dist1 = abs(i - cd[k][0]) + abs(j - cd[k][1])
        if dist1 < dist:
            dist = dist1
            ch = k + 1
    print(ch)
    dist = 10**9
Buggy python submission (verdict: Runtime Error):
w = list(input())
ans = "Yes"

for i in w:
    cnt = 0
    for j in w:
        if i == j:
            cnt += 1
    if cnt%2 == 1:
        ans = "No"
        break

print(ans

Fixed submission:
w = list(input())
ans = "Yes"

for i in w:
    cnt = 0
    for j in w:
        if i == j:
            cnt += 1
    if cnt%2 == 1:
        ans = "No"
        break

print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 0
mod = 10**9 + 7

for i in range(n):
    for j in range(i+1,n):

        ans += a[i]*a[j]
print(ans%mod)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = sum(a)**2
mod = 10**9 + 7

for i in range(n):
    ans -= a[i]**2
ans //= 2
print(ans%mod)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
ans = 0

for i in range(1,n):
    if max(a[:i]) >= a[i]:
        ans += max(a[:i]) - a[i]
print(ans)

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
ans = 0
m = 0
for i in range(n):
    m = max(m,a[i])
    ans += m - a[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())

print(a*b)

Fixed submission:
a,b=map(int,input().split())
print(a*b)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
s = 1

for i in range(n):
    s *= a[i]
    if 0 in a and s > 10**18:
        print(0)
        break
    elif 0 != a and s > 10**18:
        print(-1)
        break
    
if s <= 10**18:
    print(s)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = 1
f = 1
if 0 in a:
    print(0)
else:
    for i in a:
        s *= i
        if s > 10**18:
            print(-1)
            break
            
    if s <= 10**18:
        print(s)

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

for i in range(n):
    s *= a[i]
    if 0 in a and s > 10**18:
        print(0)
        break
    elif 0 != a and s > 10**18:
        print(-1)
        break
    
if s <= 10**18:
    print(s)


Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = 1
f = 1
if 0 in a:
    print(0)
else:
    for i in a:
        s *= i
        if s > 10**18:
            print(-1)
            break
            
    if s <= 10**18:
        print(s)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
s = 1
for i in range(n):
    s *= a[i]
    
if s > 10**18:
    print(-1)
else:
    print(s)
    

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
s = 1
f = 1
if 0 in a:
    print(0)
else:
    for i in a:
        s *= i
        if s > 10**18:
            print(-1)
            break
            
    if s <= 10**18:
        print(s)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = list(map(int,input().split()))
s = 1
if 0 in a:
    print(0)
else:
    for i in a:
        s *= i
        if s > 10**18:
            print(-1)
            break
    if s <= 10**18:
        print(s)

Fixed submission:
from decimal import * 
import math
a,b = input().split()
a = int(a)
b = Decimal(b)
print(int(a*b))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = [2,4,5,7,9]
b = [0,1,6,8]

if n[-1] in a:
  print('hon')
elif n[-1] in b:
  print('pon')
else:
  print('bon')

Fixed submission:
n = input()
a = ['2','4','5','7','9']
b = ['0','1','6','8']
if n[-1] in a:
    print('hon')
elif n[-1] in b:
    print('pon')
else:
    print('bon')
Buggy python submission (verdict: Runtime Error):
n,k = list(map(int,input().strip().split()))
temp = []
ans = int(0)
for i in range(k+1):
    d = int(input())
    li = list(map(int,input().split()))
    for j in range(d):
        temp += str(li[j])
for m in range(n+1):
    b  = str(m + 1)
    a = temp.count(b)
    if a == 0:
        ans += 1
print(ans)


Fixed submission:
n,k = map(int,input().split())
person = [0]*n
for i in range(k):
    d = int(input())
    A = list(map(int,input().split()))
    for j in range(len(A)):
        person[A[j]-1] = 1
print(person.count(0))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))
count = 0

for k in range(n-1):
    for j in range(k,n): #nC2通りを再現
        if (j+1)-a[j] == a[k]+k+1:
            count += 1
            
print(count)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
count = 0
b = []
c = []

for i in range(n):
    b.append(a[i]+i)
    c.append(i-a[i])
t = Counter(c) 
for s in b:
    count += t[s]

print(count)

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

for i in range(n-1):
    for j in range(i,n): #nC2通りを再現
        if abs(i+1-(j+1)) == a[i] + a[j]: #0スタートであることに注意
            count += 1
            
print(count)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
count = 0
b = []
c = []

for i in range(n):
    b.append(a[i]+i)
    c.append(i-a[i])
t = Counter(c) 
for s in b:
    count += t[s]

print(count)

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

for i in range(n-1):
    for j in range(i,n): #nC2通りを再現
        if abs(i+1-(j+1)) == a[i] + a[j]: #0スタートであることに注意
            count += 1
            
print(count)

Fixed submission:
from collections import Counter
n = int(input())
a = list(map(int,input().split()))
count = 0
b = []
c = []

for i in range(n):
    b.append(a[i]+i)
    c.append(i-a[i])
t = Counter(c) 
for s in b:
    count += t[s]

print(count)
Buggy python submission (verdict: Time Limit Exceeded):
import math

def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
ans = 0
if B <= N:
    N = B
for x in range(B//A , N+1):
    n = f(A,B,x)
    if n > ans:
        ans = n

print(ans)
        

Fixed submission:
import math
def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
x = min(N,B-1)
print(f(A,B,x))

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

def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
ans = 0
for x in range(B//A , N+1):
    n = f(A,B,x)
    if n > ans:
        ans = n

print(ans)
        

Fixed submission:
import math
def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
x = min(N,B-1)
print(f(A,B,x))

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

def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
ans = 0
for x in range(B//A , N+1):
    n = f(A,B,x)
    if n > ans:
        ans = n

print(ans)
        

Fixed submission:
import math
def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
x = min(N,B-1)
print(f(A,B,x))

Buggy python submission (verdict: Time Limit Exceeded):
import math
a,b,n = map(int,input().split())
max = 0
for x in range(1,n+1):
    m = math.floor(a*x/b) - a * math.floor(x/b)
    if max < m:
        max = m
        
print(max)

Fixed submission:
import math
def f(A,B,x):
    return math.floor(A*x/B) - A*math.floor(x/B)

A,B,N = map(int,input().split())
x = min(N,B-1)
print(f(A,B,x))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int,input().split()))

for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
d = {}
for i in range(1,n+1):
    if i not in d:
        d[i] = 0

for i in range(len(a)):
    d[a[i]] += 1

for i in range(1,n+1):
    print(d[i])

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

for i in range(1,n+1):
    print(a.count(i))

Fixed submission:
n = int(input())
a = list(map(int,input().split()))
d = {}
for i in range(1,n+1):
    if i not in d:
        d[i] = 0

for i in range(len(a)):
    d[a[i]] += 1

for i in range(1,n+1):
    print(d[i])
Buggy python submission (verdict: Runtime Error):
n = int(input())
print(sum(n)-sum(n/3)*3-sum(n/5)*5+sum(n/15)*15)

Fixed submission:
n = int(input())
s = 0
for i in range(1, n+1):
    if i % 15 == 0:
        pass
    elif i % 3 == 0:
        pass
    elif i % 5 == 0:
        pass
    else:
        s += i
print(s)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
c = 0

for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k] and j-i != k-j:
                c += 1
print(c)

Fixed submission:
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r * g * b

for i in range(n):
    for j in range(i+1,n):
        if s[i] == s[j]:
            continue
        k = 2*j - i
        if k >= n or s[k] == s[i] or s[k] == s[j]:
            continue
        ans -= 1
        
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
s = input()
c = 0

for i in range(n):
    for j in range(i,n):
        for k in range(j,n):
            if s[i] != s[j] and s[i] != s[k] and s[j] != s[k] and j-i != k-j:
                c += 1
print(c)

Fixed submission:
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r * g * b

for i in range(n):
    for j in range(i+1,n):
        if s[i] == s[j]:
            continue
        k = 2*j - i
        if k >= n or s[k] == s[i] or s[k] == s[j]:
            continue
        ans -= 1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)
def rec(n):
    if n == 1: 
        return 1
    return rec(n/2)*2+1

n = int(input())
print(rec(n))

Fixed submission:
import math
h = int(input())
l = 1

while (h != 1):
    h = math.floor(h / 2)
    l += 1
ans = 0

for i in range(l):
    ans += 2**i
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)
def rec(n):
    if n == 1: 
        return 1
    return rec(n/2)*2+1

n = int(input())
ans = 0
ans += rec(n)
print(ans)

Fixed submission:
import math
h = int(input())
l = 1

while (h != 1):
    h = math.floor(h / 2)
    l += 1
ans = 0

for i in range(l):
    ans += 2**i
print(ans)

Buggy python submission (verdict: Runtime Error):
def rec(n):
    if n == 1: 
        return 1
    return rec(n/2)*2+1

n = int(input())
ans = 0
ans += rec(n)
print(ans)

Fixed submission:
import math
h = int(input())
l = 1

while (h != 1):
    h = math.floor(h / 2)
    l += 1
ans = 0

for i in range(l):
    ans += 2**i
print(ans)

Buggy python submission (verdict: Runtime Error):
def rec(n):
    if n == 1: return 1
    return rec(n/2)*2+1

n = int(input())
ans = 0
ans += rec(n)
print(ans)

Fixed submission:
import math
h = int(input())
l = 1

while (h != 1):
    h = math.floor(h / 2)
    l += 1
ans = 0

for i in range(l):
    ans += 2**i
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
c = 0

for i in range(n):
    s = p[:i+1]
#sの最小値とsの末尾が一致するかどうか
    if s[-1] == min(s):
        c += 1
        
print(c)


Fixed submission:
n = int(input())
p = list(map(int,input().split()))
c = 0
m = 10**9
for i in range(n):
    if p[i] < m:
        m = p[i]
        c += 1
        
print(c)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
c = 0

for i in range(n):
    s = p[:i+1]
#sの最小値とsの末尾が一致するかどうか
    if s[-1] == min(s):
        c += 1
        
print(c)

Fixed submission:
n = int(input())
p = list(map(int,input().split()))
c = 0
m = 10**9
for i in range(n):
    if p[i] < m:
        m = p[i]
        c += 1
        
print(c)
Buggy python submission (verdict: Runtime Error):
a,b,k = map(int,input().split())

for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1
  else:
    pass

print(a,b)

Fixed submission:
s,t = input().split()

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

if k<=a
  print(a-k,b)
elif a<k<=a+b:
  print(k-a,b-(k-a))
else:
  print(0,0)

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

if a > k:
  print(a-k,b)
elif a == k:
  print(0,b)
else:
  if (a+b) > k:
    print(0,a+b-k)
  else:
    print(0,0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
a,b,k = map(int,input().split())

for i in range(k):
  if a >= 1:
    a = a-1
  elif b >= 1:
    b = b-1
  else:
    pass
print(a,b)

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

if a > k:
  print(a-k,b)
elif a == k:
  print(0,b)
else:
  if (a+b) > k:
    print(0,a+b-k)
  else:
    print(0,0)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline
a,b,k = map(int,input().split())

for i in range(k):
  if a >= 1:
    a = a-1
  elif b >= 1:
    b = b-1
  else:
    pass
print(a,b)

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

if a > k:
  print(a-k,b)
elif a == k:
  print(0,b)
else:
  if (a+b) > k:
    print(0,a+b-k)
  else:
    print(0,0)

Buggy python submission (verdict: Time Limit Exceeded):
a,b,k = map(int,input().split())
for i in range(k):
  if a >= 1:
    a = a-1
  elif b >= 1:
    b = b-1
  else:
    pass
print(a,b)

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

if a > k:
  print(a-k,b)
elif a == k:
  print(0,b)
else:
  if (a+b) > k:
    print(0,a+b-k)
  else:
    print(0,0)

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

for i in range(k):
  if a >= 1:
    a -= 1
  elif b >= 1:
    b -= 1
  else:
    pass

print(a,b)

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

if a > k:
  print(a-k,b)
elif a == k:
  print(0,b)
else:
  if (a+b) > k:
    print(0,a+b-k)
  else:
    print(0,0)