Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from math import ceil


def solve(string):
    pass
    n, *csf = map(int, string.split())
    f_list = []
    for c, s, f in csf:
        f_list = [c + ceil((max(_f, s)) / f) * f for _f in f_list]
        f_list.append(c + s)
    f_list.append(0)
    return "\n".join([str(_f) for _f in f_list])


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(n - 1)])))


Fixed submission:
#!/usr/bin/env python3

import math
import sys

n = int(sys.stdin.readline().strip())
f_list = []
for _ in range(n - 1):
    c, s, f = sys.stdin.readline().strip().split(" ")
    c = int(c)
    s = int(s)
    f = int(f)
    f_list = [c + math.ceil((max(_f, s)) / f) * f for _f in f_list]
    f_list.append(c + s)
f_list.append(0)
for _f in f_list:
    print(_f)
Buggy python submission (verdict: Runtime Error):
from math import floor, log2


def solve(string):
    x, y = map(int, string.split())
    return str(floor(log2(y) - log2(x)) + 1)


if __name__ == '__main__':
    print(solve(input()))


Fixed submission:
#!/usr/bin/env python3
# coding=utf-8

import sys

x, y = sys.stdin.readline().split(" ")

x = int(x)
y = int(y)
ans = 0
while x <= y:
    ans += 1
    x *= 2
print(ans)
Buggy python submission (verdict: Runtime Error):
from itertools import product
import numpy as np


def solve(string):
    n, *fp = map(int, string.split())
    # f = np.asarray(fp[:10 * n]).reshape((n, 10))
    f = fp[:10 * n]
    p = fp[10 * n:]
    ans = -n * 10**7
    """
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        # tmp = np.dot(f, np.asanyarray(o).T)
        tmp = [sum([for ]) for _f in f]
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)
    """
    int_f = [int("".join(map(str, f[10 * i:10 * (i + 1)])), 2) for i in range(n)]
    for o in range(1, 2**10):
        tmp = [sum(map(int, f"{o & _f:b}")) for _f in int_f]
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))


Fixed submission:
from itertools import product
import numpy as np


def solve(string):
    n, *fp = map(int, string.split())
    f = np.asarray(fp[:10 * n]).reshape((n, 10))
    p = fp[10 * n:]
    ans = -n * 10**7
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        tmp = np.dot(f, np.asanyarray(o).T)
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))

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


def solve(string):
    n, *fp = map(int, string.split())
    # f = np.asarray(fp[:10 * n]).reshape((n, 10))
    f = fp[:10 * n]
    p = fp[10 * n:]
    ans = -n * 10**7
    """
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        # tmp = np.dot(f, np.asanyarray(o).T)
        tmp = [sum([for ]) for _f in f]
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)
    """
    int_f = [int("".join(map(str, f[10 * i:10 * (i + 1)])), 2) for i in range(n)]
    for o in range(1, 2**10):
        tmp = [sum(map(int, f"{o & _f:b}")) for _f in int_f]
        print(tmp)
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))


Fixed submission:
from itertools import product
import numpy as np


def solve(string):
    n, *fp = map(int, string.split())
    f = np.asarray(fp[:10 * n]).reshape((n, 10))
    p = fp[10 * n:]
    ans = -n * 10**7
    for o in product([0, 1], repeat=10):
        if sum(o) == 0:
            continue
        tmp = np.dot(f, np.asanyarray(o).T)
        ans = max(ans, sum([p[11 * i + t] for i, t in enumerate(tmp)]))
    return str(ans)


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(2 * n)])))
Buggy python submission (verdict: Time Limit Exceeded):
from operator import lt
from functools import partial


def solve(string):
    n, *abc = map(int, string.split())
    a = sorted(abc[:n], reverse=True)
    b = sorted(abc[n:2 * n], reverse=True)
    c = sorted(abc[2 * n:], reverse=True)
    ab = [len(list(filter(partial(lt, _a), b))) for _a in a]
    bc = [0] + [len(list(filter(partial(lt, _b), c))) for _b in b]
    for i in range(1, len(bc)):
        bc[i] += bc[i - 1]
    return str(sum([bc[_ab] for _ab in ab]))


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(3)])))


Fixed submission:
def solve(string):
    n, *abc = map(int, string.split())
    a = sorted(abc[:n], reverse=True)
    b = sorted(abc[n:2 * n], reverse=True)
    c = sorted(abc[2 * n:], reverse=True)
    ab = [0] * n
    j = 0
    for i, _a in enumerate(a):
        while j <= n - 1 and _a < b[j]:
            j += 1
        ab[i] = j
    bc = [0] * (n + 1)
    j = 0
    for i, _b in enumerate(b, start=1):
        while j <= n - 1 and _b < c[j]:
            j += 1
        bc[i] = j

    for i in range(1, len(bc)):
        bc[i] += bc[i - 1]
    return str(sum([bc[_ab] for _ab in ab]))


if __name__ == '__main__':
    n = int(input())
    print(solve('{}\n'.format(n) + '\n'.join([input() for _ in range(3)])))
Buggy python submission (verdict: Runtime Error):
n,t=map(int,input().split())
l=[]
for i in range(n):
    l.append([j for j in map(int,input().split())])
    
a=float('inf')
for i in l:
    if i[1] <= t:a=i[0]
if a == float('inf'):
    a = 'TLE'
print(a)

Fixed submission:
n=int(input())
if n==1:print('Hello World')
else:
    a=int(input())
    b=int(input())
    print(a+b)

Buggy python submission (verdict: Runtime Error):
n=int(input())
if n==1:print('Hello World')
else:
    a=int(input())
    b=int(inputt())
    print(a+b)

Fixed submission:
n=int(input())
if n==1:print('Hello World')
else:
    a=int(input())
    b=int(input())
    print(a+b)
Buggy python submission (verdict: Runtime Error):
l = list(map(input().split()))
print(l[0]-l[1]+1)

Fixed submission:
l = list(map(int,input().split()))
print(l[0]-l[1]+1)
Buggy python submission (verdict: Runtime Error):
n=int(input())
if n<105:print(0)
elif n<3*5*9:print(1)
elif n<3*5*11:print(2)
else:print(3)

Fixed submission:
a,b=list(map(int,input().split()))
print((a-1)*(b-1))
Buggy python submission (verdict: Runtime Error):
import sys
s1=input ()
s2=input ()
for _ in range(len (s1)):
  if s1==s2:
    print ('Yes ')
    sys.exit ()
  s1=s1[-1]+s[:-1]
print ('No ')

Fixed submission:
import sys
s1=input ()
s2=input ()
for _ in range(len (s1)):
  if s1==s2:
    print ('Yes ')
    sys.exit ()
  s1=s1[-1]+s1[:-1]
print ('No ')
Buggy python submission (verdict: Runtime Error):
a,b=map (int,input ().split ())
print (max [a+b,a-b,a*b])

Fixed submission:
a,b=map (int,input ().split ())
print (max([a+b,a-b,a*b]))
Buggy python submission (verdict: Time Limit Exceeded):
a,b,c=map(int,input().split())
print("\n".join([str(i) for i in range(a,b+1) if abs(a-i)<c or abs(b-i)<c]))

Fixed submission:
a,b,c=map(int,input().split())
l=set()
for i in range(a,a+c):
    if i!=b:l.add(i)
    else:break
for i in range(max(b-c+1,a),b+1):
        l.add(i)
print("\n".join(map(str,sorted(list(l)))))
Buggy python submission (verdict: Time Limit Exceeded):
l=int(input())
 
list=[]
for i in range(l):
    a=input()
    try:
        del list[list.index(a)]
    except ValueError:
        list.append(a)
 
print(len(list))

Fixed submission:
l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)

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

list=[0]*1000000000
for i in range(l):
    a=input()
    if list[a]==1:
        list[a]=0
    else:
        list[a]=1

print(list.count(1))

Fixed submission:
l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)

Buggy python submission (verdict: Time Limit Exceeded):
l=int(input())
 
list=[]
for i in range(l):
    a=input()
    if a in list:
        list.remove(a)
    else:
        list.append(a)
 
print(len(list))

Fixed submission:
l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)

Buggy python submission (verdict: Time Limit Exceeded):
l=int(input())

list=[]
for i in range(l):
    a=int(input())
    if a in list:
        list.remove(a)
    else:
        list.append(a)

print(len(list))

Fixed submission:
l=int(input())
 
dic={}
for i in range(l):
    a=input()
    dic[a]=dic.get(a, 0) + 1
n=0
for x in dic.values():
    if x%2==1:
        n+=1

print(n)
Buggy python submission (verdict: Runtime Error):
f=lambda(x):x%3==0
a,b=map(int,input().split())
print(['Impossible','Possible'][f(a)or f(b)or f(a+b)])

Fixed submission:
f=lambda x:x%3==0
a,b=map(int,input().split())
print(['Impossible','Possible'][f(a)or f(b)or f(a+b)])
Buggy python submission (verdict: Time Limit Exceeded):
import math as m
a,b=map(int,input().split())
print(m.factorial(a)*m.factorial(b)*[1,2][a==b] if -2<a-b<2 else 0)

Fixed submission:
m=1000000007
f=lambda j,k:(j%m)*(k%m)%m
a,b=sorted(map(int,input().split()))
x=1
for i in range(2,a+1):
  x=f(x,i)
print(f(f(x,[x*b,x][a==b]),[1,2][a==b]) if b-a<2 else 0)
Buggy python submission (verdict: Runtime Error):
input();l=list(map(int,input().split()).sort();print(l[-1]-l[0])

Fixed submission:
input();l=sorted(list(map(int,input().split())));print(l[-1]-l[0])
Buggy python submission (verdict: Runtime Error):
import sys
def color(x):
  if x<400:return('灰')
  elif 399<x<800:return('茶')
  elif 799<x<1200:return('緑')
  elif 1199<x<1600:return('水')
  elif 1599<x<2000:return('青')
  elif 1999<x<2400:return('黄')
  elif 2399<x<2800:return('橙')
  elif 2799<x<3200:return('赤')
  else:return('*')
input()
l=list(map(int,input().split()))
l=[color(i) for i in l]
v=l.count('*')
l=len(set(l))
if v==0:
  print(' '.join([l]*2))
  sys.exit()
elif v>len(l):print(v,end=' ')
else: print(l,end=' ')
print(max(l+v,8))


Fixed submission:
import sys
def color(x):
  if x<400:return('灰')
  elif 399<x<800:return('茶')
  elif 799<x<1200:return('緑')
  elif 1199<x<1600:return('水')
  elif 1599<x<2000:return('青')
  elif 1999<x<2400:return('黄')
  elif 2399<x<2800:return('橙')
  elif 2799<x<3200:return('赤')
  else:return('*')
input()
l=list(map(int,input().split()))
l=[color(i) for i in l]
v=l.count('*')
c=v==len(l)
l=len(set(l))
if v==0:
  print(' '.join([str(l)]*2))
  sys.exit()
else:
  if c:v-=1
  else:l-=1
  print(l,end=' ')
print(l+v)
Buggy python submission (verdict: Runtime Error):
s=input();a=s[0]+s[-1];print('error' if a>9 else a)

Fixed submission:
s=input();a=int(s[0])+int(s[-1]);print('error' if a>9 else a)
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=sorted([int(input()) for _ in range(n)])
s=sum(l)
for i in l[::-1]:
  if i%10>0:k=s-i
print(s if s%10>0 else k)

Fixed submission:
n=int(input())
l=sorted([int(input()) for _ in range(n)])
s=sum(l)
k=0
for i in l[::-1]:
  if i%10>0:k=s-i
print(s if s%10>0 else k)
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,6,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])

Fixed submission:
x,y=map(int,input().split())
l=[[4,6,9,11],[2],[1,3,5,7,8,10,12]]
for i in l:
  if x in i:xx=l.index(i)
  if y in i:yy=l.index(i)
print('YNeos'[xx!=yy::2])
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split());print('DH'[a==b])

Fixed submission:
a,b=input().split();print('DH'[a==b])
Buggy python submission (verdict: Runtime Error):
print('AARBCC'[x<1200::2])

Fixed submission:
print('AARBCC'[int(input())<1200::2])
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
sum = 0
for i in range(len(str(n))):
    sum += (n % 10)
    n //= 10
if sum % 9 == 0:
    print("Yes")
else:
    print("No")

Fixed submission:
n = int(input())
if n % 9 == 0:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
wa = 0
l = list(map(int, input().split()))
for i in range(1, n):
    if max(l[:i]) >= l[i]:
        wa += max(l[:i]) - l[i]
print(wa)

Fixed submission:
n = int(input())
wa = 0
m = 0
l = list(map(int, input().split()))
for i in range(n):
    m = max(l[i], m)
    if m > l[i]:
        wa += m - l[i]
print(wa)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
cnt = 1
l = list(map(int, input().split()))
for i in l:
    cnt *= i
if cnt > 10** 18:
    print(-1)
else:
    print(cnt)

Fixed submission:
n = int(input())
cnt = 1
l = list(map(int, input().split()))
if 0 in l:
    print(0)
else:
    for i in l:
        cnt *= i
        if cnt > 10 ** 18:
            print(-1)
            exit()
        else:
            pass
    print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * n
for i in a:
    if a.count(i) >= 1:
        p = 1
    else:
        p = 0
        
    cnt[i - 1] += p

for i in cnt:
    print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * n
for i in a:
    cnt[i - 1] += 1

for i in cnt:
    print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * n
for i in a:
    if a.count(i) >= 1:
        p = 1
    else:
        p = 0
        
    cnt[i - 1] += p

for i in cnt:
    print(i)

Fixed submission:
n = int(input())
a = list(map(int, input().split()))
cnt = [0] * n
for i in a:
    cnt[i - 1] += 1

for i in cnt:
    print(i)
Buggy python submission (verdict: Time Limit Exceeded):
k = int(input())
def gcd(a,b):
    if ( b==0 ):
        return a
    else:
        return (gcd(b, a%b))
cnt = 0
l = []
for i in range(1, k + 1):
    for j in range(1, k + 1):
        
        l.append(gcd(i, j))
for h in range(1, k + 1):
    for p in l:
        cnt += gcd(h, p)
print(cnt)

Fixed submission:
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)
k = int(input())
cnt = 0
for i in range(1, k + 1):
    for j in range(1, k + 1):
        for h in range(1, k + 1):
            cnt += gcd(i, j, h)
print(cnt)
Buggy python submission (verdict: Runtime Error):
s = input()

if s[0] == "h" and s[1] == "i" and s[1] != s[2]:
    print("Yes")

else:
    print("No")
    

Fixed submission:
s = input()
i = int(len(s) / 2)
if "hi" * i == s:
    print("Yes")

else:
    print("No")
Buggy python submission (verdict: Runtime Error):
a, b, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = [map(int, input().split()) for i in range(m)]
ans = min(a) + min(b)
for i in range(m):
    ai = a[l[i][0] - 1]
    bi = b[l[i][0] - 1]
    ci = c[l[i][0] - 1]
    nc = ai + bi - c
    ans = min(ans, nc)
print(nc)
    

Fixed submission:
A, B, m = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
l = [input().split() for i in range(m)]
ans = min(a) + min(b)

for i in range(m):
    ai = a[int(l[i][0]) - 1]
    bi = b[int(l[i][1]) - 1]
    ci = int(l[i][2])
    nc = ai + bi - ci
    ans = min(ans, nc)
print(ans)
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = ""
cnt = 0
n1 = "b" * A
n2 = "r" * B
for i in range(N + 2):
    l += n1 + n2
   
for j in l[0 : N]:
    if j == "b":
        cnt += 1
          
print(cnt)


Fixed submission:
n, a, b = map(int,input().split())
if a == 0 and b == 0:
    print(0)
if a != 0 or b != 0:
         
    kumi = n // (a + b)
    nokori = n % (a + b)
    if nokori == 0:
        print(a * kumi)
    elif nokori >= 1 and nokori < a:
        print(a * kumi + nokori)
    elif nokori >= a:
        print(a * kumi + a)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = ""
cnt = 0
for i in range(N + 1):
    n1 = "b" * A
    n2 = "r" * B
    l += n1 + n2
    
for j in l[0 : N]:
    if j == "b":
        cnt += 1
          
print(cnt)


Fixed submission:
n, a, b = map(int,input().split())
if a == 0 and b == 0:
    print(0)
if a != 0 or b != 0:
         
    kumi = n // (a + b)
    nokori = n % (a + b)
    if nokori == 0:
        print(a * kumi)
    elif nokori >= 1 and nokori < a:
        print(a * kumi + nokori)
    elif nokori >= a:
        print(a * kumi + a)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
l = ""
cnt = 0
for i in range(10 **100):
    n1 = "b" * A
    n2 = "r" * B
    l += n1 + n2
    for j in range(N):
       if j == "b":
           cnt += 1
print(cnt)

Fixed submission:
n, a, b = map(int,input().split())
if a == 0 and b == 0:
    print(0)
if a != 0 or b != 0:
         
    kumi = n // (a + b)
    nokori = n % (a + b)
    if nokori == 0:
        print(a * kumi)
    elif nokori >= 1 and nokori < a:
        print(a * kumi + nokori)
    elif nokori >= a:
        print(a * kumi + a)
Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

else:
    print(int((R + 100(10 - N))))


Fixed submission:
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

elif N < 10:
    print((R + 100 * (10 - N)))

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

else:
    printint((R + 100(10 - N)))
    

Fixed submission:
l = list(map(int, input().split()))
N = l[0]
R = l[1]
if N >= 10:
    print(R)

elif N < 10:
    print((R + 100 * (10 - N)))
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
import collections
l = [input() for i in range(n)]
l_cnt = collections.Counter(l)
l_cnt_max = []
for i in l_cnt:
    if l_cnt[i] == max(l_cnt.values()):
        l_cnt_max.append(i)
m = sorted(l_cnt_max)
for i in m:
    print(i)

Fixed submission:
n = int(input())
l = [input() for i in range(n)]
d = {}
for i in l:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
d_max = max(d.values())
for i in sorted(d):
    if d[i] == d_max:
        print(i)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
import collections
l = [input() for i in range(n)]
l_cnt = collections.Counter(l)
l_cnt_max = []
for i in l_cnt:
    if l_cnt[i] == max(l_cnt.values()):
        l_cnt_max.append(i)
m = sorted(l_cnt_max)
for i in m:
    print(i)

Fixed submission:
n = int(input())
l = [input() for i in range(n)]
d = {}
for i in l:
    if i in d:
        d[i] += 1
    else:
        d[i] = 1
d_max = max(d.values())
for i in sorted(d):
    if d[i] == d_max:
        print(i)
Buggy python submission (verdict: Runtime Error):
 = int(input())
p = list(map(int, input().split()))
cnt = 0
tmp = 2 * 10 ** 6
for i in range(n):
    if p[i] <= tmp:
        cnt += 1
        tmp = min(tmp, p[i])
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
tmp = 2 * 10 ** 6
for i in range(n):
    if p[i] <= tmp:
        cnt += 1
        tmp = min(tmp, p[i])
print(cnt)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int, input().split()))
cnt = 0
for i in range(n):
    if p[i] == min(p[:i + 1]):
        cnt += 1
print(cnt)

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
cnt = 0
tmp = 2 * 10 ** 6
for i in range(n):
    if p[i] <= tmp:
        cnt += 1
        tmp = min(tmp, p[i])
print(cnt)
Buggy python submission (verdict: Runtime Error):
a, b, k = map(int,input().split())
ans_a = a - k
if ans_a < 0:
    ans_a = 0
    ans_b = b - abs(ans_a)
    if ans_b < 0 or k - a >= b:
        ans_b = 0
print(str(ans_a) + " " + str(ans_b))

Fixed submission:
a, b, k = map(int, input().split())
if k < a:
    print(str(a - k) + " " + str(b))
elif a <= k and k < a + b:
    print(str(0) + " " + str(b - k + a))
elif k >= a + b:
    print(str(0) + " " + str(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
        
        
    
        if a == 0 and b >= 1:
            b -= 1
            if b == 0:
                exit()
    
print(str(a) + " " + str(b))

Fixed submission:
a, b, k = map(int, input().split())
if k < a:
    print(str(a - k) + " " + str(b))
elif a <= k and k < a + b:
    print(str(0) + " " + str(b - k + a))
elif k >= a + b:
    print(str(0) + " " + str(0))
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())
l = []
for i in range(1, A * B + 1):
    if i % A == 0 and i % B == 0:
        l.append(i)
print(min(l))

Fixed submission:
A, B = map(int, input().split())
num = 0
for i in range(B + 1):
    num += A
    if  num % B == 0:
        break
print(num)
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if max(a,b) <= 9:
    print(int(a * b))

else:
    print(-1)


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

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input().split())
if a >= 10 or b >= 10:
    print(int(a * b))

else:
    print(-1)


Fixed submission:
num = int(input())
print(int(num * num))
Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
if a >= 10 or b >= 10:
    print(int(a * b))

else:
    print(-1)


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

if max(a, b) <= 9:
  print(a * b)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
if a >= 10 or b >= 10:
    print(a * b)

else:
    print(-1)


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

if max(a, b) <= 9:
  print(a * b)
else:
  print(-1)

Buggy python submission (verdict: Runtime Error):
a, b = map(int, input())
if a >= 10 or a >= 10:
    print(a * b)

else:
    print(-1)

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

if max(a, b) <= 9:
  print(a * b)
else:
  print(-1)
Buggy python submission (verdict: Runtime Error):
l = ["Sunny", "Cloudy", "Rainy"]
w = input()

if l.index(w) = 2:
    print("Sunny")

else:
    print(l[l.index(w) + 1])

Fixed submission:
l = ["Sunny", "Cloudy", "Rainy"]
w = input()

if l.index(w) == 2:
    print("Sunny")

else:
    print(l[l.index(w) + 1])
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ap = 0
ad = 0
for i in a:
    ap += b[i - 1]
    
for j in range(1, len(a)):
    
    if a[j] - a[j - 1] == 1:
            ad += c[j]

print(ap + ad)
        

Fixed submission:
N = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
ap = 0
ad = 0
for i in a:
    ap += b[i - 1]
    
for j in range(1, len(a)):
    
    if a[j] - a[j - 1] == 1:
            ad += c[a[j - 1] - 1]

print(ap + ad)
Buggy python submission (verdict: Runtime Error):
l = input().split()
m = input().split()
cnt = 0
for i in range(3):
    if l[i] == m[i]:
        cnt += 1
print(cnt)

    

Fixed submission:
l = list(input())
m = list(input())
cnt = 0
for i in range(3):
    if l[i] == m[i]:
        cnt += 1

print(cnt)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = map(int, input().split())
l = []
for i in range(1, n + 1):
    if i != p[i - 1]:
        l.append(i)
if len(l) == 2:
    print("YES")
else:
    print("NO")
        

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
l = []
for i in range(1, n + 1):
    if i != p[i - 1]:
        l.append(i)
if len(l) <= 2:
    print("YES")
else:
    print("NO")