Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.repliace(' ', ''))

Fixed submission:
def main(s, t):
    print(t, s, sep="")


if __name__ == "__main__":
    s, t = input().split()

    main(s, t)

Buggy python submission (verdict: Runtime Error):
s = input()
print(s.repliace(' ', '')

Fixed submission:
def main(s, t):
    print(t, s, sep="")


if __name__ == "__main__":
    s, t = input().split()

    main(s, t)
Buggy python submission (verdict: Time Limit Exceeded):
def main(n: int, a: list):
    ans = 0

    i = 1

    if 1 not in a:
        print(-1)
        return

    while len(a) > 0:
        if a[0] != i:
            a.pop(0)
            ans += 1
            continue
        i += 1
        a.pop(0)

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)


Fixed submission:
def main(n: int, a: list):
    ans = 0

    i = 1

    if 1 not in set(a):
        print(-1)
        return

    for _a in a:
        if _a != i:
            ans += 1
        else:
            i += 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)
Buggy python submission (verdict: Runtime Error):
def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)


Fixed submission:
from string import ascii_uppercase as ascii


def main(n: int, s: str):
    ans = ""
    for _s in s:
        ans += ascii[(ascii.index(_s) + n) % 26]

    print(ans)


if __name__ == "__main__":
    n = int(input())
    s = input()

    main(n, s)
Buggy python submission (verdict: Runtime Error):
def main(x: int, y: int):
    award: int = 0

    if (x and y) == 1:
        award += 400000

    for i in [x, y]:
        if i == 1:
            award += 300000
        elif i == 2:
            award += 200000
        elif i == 3:
            award += 100000

    print(award)


if __name__ == "__main__":
    x, y = map(int, input().split())

    main(x, y)


Fixed submission:
def main(x: int, y: int):
    award = 0

    if x == y == 1:
        award += 400000

    for i in [x, y]:
        if i == 1:
            award += 300000
        elif i == 2:
            award += 200000
        elif i == 3:
            award += 100000

    print(award)


if __name__ == "__main__":
    x, y = map(int, input().split())

    main(x, y)
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3
import sys
from typing import List


def solve(N: int, K: int, h: "List[int]"):
    persons = 0

    for _h in h:
        if _h >= K:
            persons += 1

    print(persons)
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, h)


if __name__ == '__main__':
    main()


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


def solve(N: int, K: int, h: "List[int]"):
    persons = 0

    for _h in h:
        if _h >= K:
            persons += 1

    print(persons)


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    h = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, h)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main(s: str):
    if re.match(r'^([^L][^R])*[^L]$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)


Fixed submission:
import re


def main(s: str):
    if re.match(r'^([^L][^R])*[^L]?$', s):
        print('Yes')
    else:
        print('No')


if __name__ == "__main__":
    s = input()

    main(s)
Buggy python submission (verdict: Runtime Error):
def main(S, T):
    count = 0

    for i in range(len(S)):
        if T[i] == S[i]:
            count += 1

    return count


if __name__ == "__main__":
    S, T = map(str, input().split())
    print(main(S, T))


Fixed submission:
def main(S, T):
    count = 0

    for i in range(len(S)):
        if T[i] == S[i]:
            count += 1

    return count


if __name__ == "__main__":
    S = input()
    T = input()
    print(main(S, T))
Buggy python submission (verdict: Runtime Error):
def main(n):
    count = 0

    for i in range(n + 1):
        if str(i).__len__ % 2 == 1:
            count += 1

    print(count)


if __name__ == "__main__":
    n = int(input())

    main(n)


Fixed submission:
def main(n):
    count = 0

    for i in range(1, n + 1):
        if len(str(i)) % 2 == 1:
            count += 1

    print(count)


if __name__ == "__main__":
    n = int(input())

    main(n)
Buggy python submission (verdict: Time Limit Exceeded):
def main(n: int, a: list):
    for i in range(n):
        t = a.copy()
        t[i] = 0

        print(max(t))


if __name__ == "__main__":
    n = int(input())
    a = [int(input()) for _ in range(n)]

    main(n, a)


Fixed submission:
def main(n: int, a: list):
    a_max, a_second = sorted(a, reverse=True)[:2]

    for i in range(n):
        if a[i] != a_max:
            print(a_max)
        else:
            print(a_second)


if __name__ == "__main__":
    n = int(input())
    a = [int(input()) for _ in range(n)]

    main(n, a)

Buggy python submission (verdict: Time Limit Exceeded):
def main(n: int, a: list):
    ans = 0
    for i in range(n):
        t = a.copy()
        t[i] = 0

        print(max(t))


if __name__ == "__main__":
    n = int(input())
    a = [int(input()) for _ in range(n)]

    main(n, a)


Fixed submission:
def main(n: int, a: list):
    a_max, a_second = sorted(a, reverse=True)[:2]

    for i in range(n):
        if a[i] != a_max:
            print(a_max)
        else:
            print(a_second)


if __name__ == "__main__":
    n = int(input())
    a = [int(input()) for _ in range(n)]

    main(n, a)
Buggy python submission (verdict: Runtime Error):
import math
W, H, x, y = map(int, input().split(' '))

f_x, i_x = math.modf(W / x)
f_y, i_y = math.modf(H / y)

if f_x == 0 and f_y == 0:
    print(float(W * y), 1)
elif f_x == 0:
    print(float(H * x), 0)
elif f_y == 0:
    print(float(H * x), 0)


Fixed submission:
def main(W: int, H: int, x: int, y: int):
    area = W * H
    count = 0

    if x * 2 == W and y * 2 == H:
        count = 1

    print("{:.6f}".format(area / 2), count)


if __name__ == "__main__":
    W, H, x, y = map(int, input().split())

    main(W, H, x, y)
Buggy python submission (verdict: Runtime Error):
'''A - Airplane
https://atcoder.jp/contests/abc129/tasks/abc129_a

>>> main(1, 3, 4)
4
>>> main(3, 2, 3)
5
'''

from itertools import permutations


def main(p, q, r):
    _max = 100

    for p in permutations([p, q, r], 2):
        if _max > sum(p):
            _max = sum(p)

    print(_max)


if __name__ == '__main__':
    p, q, r = map(int, input().split(' '))
    main()


Fixed submission:
'''A - Airplane
https://atcoder.jp/contests/abc129/tasks/abc129_a

>>> main(1, 3, 4)
4
>>> main(3, 2, 3)
5

in5.txt
>>> main(99, 62, 92)
154'''

from itertools import permutations


def main(p, q, r):
    _max = 999

    for p in permutations([p, q, r], 2):
        if _max > sum(p):
            _max = sum(p)

    print(_max)


if __name__ == '__main__':
    p, q, r = map(int, input().split(' '))
    main(p, q, r)
Buggy python submission (verdict: Runtime Error):
'''A - White Cells
https://atcoder.jp/contests/abc121/tasks/abc121_a

>>> main([3, 2], [2, 1])
1
>>> main([5, 5], [2, 3])
6
>>> main([2, 4], [2, 4])
0'''


def main(amount, portion):
    print((amount[0] - portion[0]) * (amount[1] - portion[1]))


if __name__ == "__main__":
    amount = map(int, input().split(' '))
    portion = map(int, input().split(' '))

    main(amount, portion)


Fixed submission:
'''A - White Cells
https://atcoder.jp/contests/abc121/tasks/abc121_a

>>> main([3, 2], [2, 1])
1
>>> main([5, 5], [2, 3])
6
>>> main([2, 4], [2, 4])
0'''


def main(amount, portion):
    print((amount[0] - portion[0]) * (amount[1] - portion[1]))


if __name__ == "__main__":
    amount = list(map(int, input().split(' ')))
    portion = list(map(int, input().split(' ')))

    main(amount, portion)
Buggy python submission (verdict: Runtime Error):
def main(n, x_u):
    ans = 0
    btc = 380000.0

    for x, u in x_u:
        if u == 'JPY':
            ans += x
        else:
            ans += x * btc

    print(ans)


if __name__ == "__main__":
    n = int(input())
    x_u = [list(map(int, input().split())) for _ in range(n)]

    main(n, x_u)


Fixed submission:
def main(n, x_u):
    ans = 0
    btc = 380000.0

    for x, u in x_u:
        if u == 'JPY':
            ans += int(x)
        else:
            ans += float(x) * btc

    print(ans)


if __name__ == "__main__":
    n = int(input())
    x_u = [input().split() for _ in range(n)]

    main(n, x_u)
Buggy python submission (verdict: Runtime Error):
def main(N, K):
    if N - 1 >= K:
        return 'YES'
    else:
        return 'NO'


if __name__ == '__main__':
    N, K = map(int, input().split(' '))
    print(main())


Fixed submission:
def main(N, K):
    if K * 2 - 1 <= N:
        return 'YES'
    else:
        return 'NO'


if __name__ == '__main__':
    N, K = map(int, input().split(' '))
    print(main(N, K))
Buggy python submission (verdict: Runtime Error):
def main(n):
    print(str(n).count('2'))


if __name__ == '__main__':
    n = int(input())
    main()


Fixed submission:
def main(n):
    print(str(n).count('2'))


if __name__ == '__main__':
    n = int(input())
    main(n)
Buggy python submission (verdict: Runtime Error):
def main(n: int, k: int, h: list):
    h.sort()

    print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))


if __name__ == "__main__":
    n, k = map(int, input().split())
    h = [input() for _ in range(n)]

    main(n, k, h)


Fixed submission:
def main(n: int, k: int, h: list):
    h.sort()

    print(min([h[i + k - 1] - h[i] for i in range(n - k + 1)]))


if __name__ == "__main__":
    n, k = map(int, input().split())
    h = [int(input()) for _ in range(n)]

    main(n, k, h)
Buggy python submission (verdict: Runtime Error):
input_str = str(input()).split()
a, b, k = int(input_str[0]), int(input_str[1]), int(input_str[2])

self = a
partner = b

for i in range(k):
    if self % 2 == 1:
        self += -1

    partner += int(self / 2)
    self = int(self / 2)

    self, partner = partner, self
    i -= 1

if i % 2 == 1:
    a = partner
    b = self
else:
    b = partner
    a = self

print(a, b)


Fixed submission:
s = input()

if s.__len__() == 3:
    print(s[::-1])
else:
    print(s)
Buggy python submission (verdict: Runtime Error):
'''A - Train
https://atcoder.jp/contests/abc107/tasks/abc107_a

>>> main(4, 2)
3
>>> main(1, 1)
1
>>> main(15, 11)
5'''


def main(n, i):
    print(n - i + 1)


if __name__ == '__main__':
    main(map(int, input().split(' ')))


Fixed submission:
'''A - Train
https://atcoder.jp/contests/abc107/tasks/abc107_a

>>> main(4, 2)
3
>>> main(1, 1)
1
>>> main(15, 11)
5'''


def main(n, i):
    print(n - i + 1)


if __name__ == '__main__':
    n, i = map(int, input().split(' '))
    main(n, i)
Buggy python submission (verdict: Runtime Error):
from math import sqrt
from itertools import combinations


def main(n, d, x):
    ans = 0
    for a, b in combinations(x, 2):
        r = 0
        for c, d in zip(a, b):
            r += abs(c - d)**2

        if sqrt(r).is_integer():
            ans += 1

    print(ans)


if __name__ == '__main__':
    n, d = map(int, input().split())
    x = [list(map(int, input().split())) for _ in range(n)]

    main(n, d, x)


Fixed submission:
def main(n):
    ans = 0

    for i in range(1, n + 1):
        if i % 2 == 0:
            continue

        l = 0
        for j in range(1, i + 1):

            if i % j == 0:
                l += 1

        if l == 8:
            ans += 1

    print(ans)


if __name__ == "__main__":
    n = int(input())

    main(n)
Buggy python submission (verdict: Runtime Error):
def main(s, k):
    for s in s:
        if s != '1':
            print(s)
            return


if __name__ == "__main__":
    s = int(input())
    k = int(input())

    main(s, k)


Fixed submission:
def main(s: str, k: int):
    for i in range(k):
        if s[i] != "1":
            print(s[i])
            return

    print(1)


if __name__ == "__main__":
    s = input()
    k = int(input())

    main(s, k)
Buggy python submission (verdict: Runtime Error):
def main(n, a):
    ans = 0

    for i in a:
        ans += i - 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = lis(map(int, input().split()))

    main(n, a)


Fixed submission:
def main(n, a):
    ans = 0

    for i in a:
        ans += i - 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)

Buggy python submission (verdict: Runtime Error):
def main(n, a):
    ans = 0

    for i in a:
        ans += i - 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = [int(input()) for _ in range(n)]

    main(n, a)


Fixed submission:
def main(n, a):
    ans = 0

    for i in a:
        ans += i - 1

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)
Buggy python submission (verdict: Runtime Error):
def main(n: int, a: list):
    prev = [0, 0]
    ans = 0

    for _a in a:
        if _a == prev[0]:
            if prev[1] % 2 == 0:
                ans += 1

            prev[1] += 1
        else:
            prev = [_a, 0]

    print(ans)


if __name__ == '__main__':
    n = int(input())
    a = map(int(input().split()))

    main(n, a)


Fixed submission:
def main(n: int, a: list):
    prev = [0, 0]
    ans = 0

    for _a in a:
        if _a == prev[0]:
            if prev[1] % 2 == 0:
                ans += 1

            prev[1] += 1
        else:
            prev = [_a, 0]

    print(ans)


if __name__ == '__main__':
    n = int(input())
    a = map(int, input().split())

    main(n, a)
Buggy python submission (verdict: Runtime Error):
def main(n, a):
    ans = 0
    for i, j in permutations(a, 2):
        ans = max(ans, i - j)

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)


Fixed submission:
from itertools import permutations


def main(n, a):
    ans = 0
    for i, j in permutations(a, 2):
        ans = max(ans, i - j)

    print(ans)


if __name__ == "__main__":
    n = int(input())
    a = list(map(int, input().split()))

    main(n, a)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split(' '))

if b - a == c - b:
    print('YES')
else:
    print('NO')


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


def solve(A: int, B: int):
    if A % 2 != 0 or B % 2 != 0:
        if A > 8 or B > 8:
            print(':(')
            return

    print('Yay!')
    return


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    solve(A, B)


if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
def main(a, b):
    add = a + b
    sub = a - b
    mul = a * b

    return max(add, sub, mul)


if __name__ == "__main__":
    a, b = input().split(' ')
    print(main(a, b))


Fixed submission:
def main(a, b):
    add = a + b
    sub = a - b
    mul = a * b

    return max(add, sub, mul)


if __name__ == "__main__":
    a, b = map(int, input().split(' '))
    print(main(a, b))
Buggy python submission (verdict: Runtime Error):
def main(a, b):
    days = a * 30 + b

    count = 0
    for i in range(1, min(a, b) + 1):
        if isinstance(int, (days // i * 30 + b)):
            count += 1

    return count

if __name__ == '__main__':
    print(main(map(int, input().split(' '))))


Fixed submission:
def main(a, b):
    if b < a:
        return a-1
    else:
        return a


if __name__ == '__main__':
    a, b = map(int, input().split(' '))
    print(main(a, b))
Buggy python submission (verdict: Runtime Error):
def main(n, m, x, a):
    line = [0 for _ in range(n)]

    for a in a:
        line[a - 1] = 1

    to_left = sum(line[x - 1:])
    to_right = sum(line[x - 1::-1])

    print(min(to_left, to_right))


if __name__ == '__main__':
    n, m, x = map(int, input().split())
    a = list(input().split())

    main(n, m, x, a)


Fixed submission:
"""B - Toll Gates
https://atcoder.jp/contests/abc094/tasks/abc094_b
N M X
A_1 A_2 ... A_M

>>> main(5, 3, 3, [1, 2, 4])
1
>>> main(7, 3, 2, [4, 5, 6])
0
>>> main(10, 7, 5, [1, 2, 3, 4, 6, 8, 9])
3
"""


def main(n, m, x, a):
    line = [0 for _ in range(n)]

    for a in a:
        line[a - 1] = 1

    to_left = sum(line[x - 1:])
    to_right = sum(line[x - 1::-1])

    print(min(to_left, to_right))


if __name__ == '__main__':
    n, m, x = map(int, input().split())
    a = list(map(int, input().split()))

    main(n, m, x, a)
Buggy python submission (verdict: Runtime Error):
def main(A: int, B: int, C: int, D: int):
    train, bus = 0, 0
    if A <= B:
        train += A
    else:
        train += B

    if C <= D:
        bus += C
    else:
        bus += D

    return train + bus


if __name__ == '__main__':
    A, B, C, D = map(int, input().split(' '))
    print(main(A, B, C, D))


Fixed submission:
def main(A: int, B: int, C: int, D: int):
    train, bus = 0, 0
    if A <= B:
        train += A
    else:
        train += B

    if C <= D:
        bus += C
    else:
        bus += D

    return train + bus


if __name__ == '__main__':
    A = int(input())
    B = int(input())
    C = int(input())
    D = int(input())
    print(main(A, B, C, D))
Buggy python submission (verdict: Runtime Error):
def main(n, s: list, m, t: list):
    choices = set(s + t)

    ans = [0]

    for choice in choices:
        ans_t = 0
        for _s in s:
            if choice == _s:
                ans_t += 1
        for _t in t:
            if choice == _t:
                ans_t -= 1

        ans.append(ans_t)

    print(max(ans))


if __name__ == "__main__":
    n = int(input())
    s = [input() for _ in range(n)]
    m = int(input())
    t = [input() for _ in range(n)]

    main(n, s, m, t)


Fixed submission:
def main(n, s: list, m, t: list):
    choices = set(s + t)

    ans = [0]

    for choice in choices:
        ans_t = 0
        for _s in s:
            if choice == _s:
                ans_t += 1
        for _t in t:
            if choice == _t:
                ans_t -= 1

        ans.append(ans_t)

    print(max(ans))


if __name__ == "__main__":
    n = int(input())
    s = [input() for _ in range(n)]
    m = int(input())
    t = [input() for _ in range(m)]

    main(n, s, m, t)
Buggy python submission (verdict: Runtime Error):
def main(n, s):
    a = set(s)

    if len(a) == 3:
        print('Three')
    elif len(a) == 4:
        print('Four')


if __name__ == "__main__":
    n = int(input())
    s = list(map(int, input().split()))

    main(n, s)


Fixed submission:
def main(n, s):
    a = set(s)

    if len(a) == 3:
        print('Three')
    elif len(a) == 4:
        print('Four')


if __name__ == "__main__":
    n = int(input())
    s = list(input().split())

    main(n, s)
Buggy python submission (verdict: Time Limit Exceeded):
def main(x, y):
    if x % y == 0:
        print(-1)
        return

    i = max(x, y) + 1

    while True:
        if (i % x) == 0 and (i % y) != 0:
            print(i)
            break

        i += 1


if __name__ == '__main__':
    x, y = map(int, input().split(' '))
    main(x, y)


Fixed submission:
def main(x, y):
    if x % y == 0:
        print(-1)
    else:
        print(x)


if __name__ == '__main__':
    x, y = map(int, input().split(' '))

    main(x, y)
Buggy python submission (verdict: Time Limit Exceeded):
def main(n: int, k: int, a: list):
    calc = [0 for i in range(n)]
    ans = 0 
    for _a in a:
        calc[_a - 1] += 1

    calc = [i for i in calc if i != 0]
    calc.sort()

    while len(calc) > k:
        ans += calc.pop(0)
    
    print(ans)

if __name__ == '__main__':
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    main(n, k, a)


Fixed submission:
from collections import Counter


def main(n: int, k: int, a: list):
    calc = Counter(a)
    calc = sorted(calc.values())

    print(sum(calc[:len(calc) - k]))


if __name__ == '__main__':
    n, k = map(int, input().split())
    a = list(map(int, input().split()))

    main(n, k, a)
Buggy python submission (verdict: Runtime Error):
def main(s: str):
    if re.fullmatch(r"A?KIHA?BA?RA?", s):
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    s = input()

    main(s)


Fixed submission:
import re


def main(s: str):
    if re.fullmatch(r"A?KIHA?BA?RA?", s):
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    s = input()

    main(s)
Buggy python submission (verdict: Runtime Error):
def main(q: int, h: int, s: int, d: int, n: int):
    print((n // 2) * min(q * 8, h * 4, s * 2, d) + (n % 2) * min(q * 4, h * 2, s))


if __name__ == "__main__":
    q, h, s, d = map(int, input().split())
    n = int(input)

    main(q, h, s, d, n)


Fixed submission:
def main(q: int, h: int, s: int, d: int, n: int):
    print((n // 2) * min(q * 8, h * 4, s * 2, d) + (n % 2) * min(q * 4, h * 2, s))


if __name__ == "__main__":
    q, h, s, d = map(int, input().split())
    n = int(input())

    main(q, h, s, d, n)
Buggy python submission (verdict: Runtime Error):
from itertools import combinations


def main(n: int, a: int, b: int):

    if a > b:
        print(0)
        return
    elif a == b:
        print(1)
        return

    if n < 3:
        if n == 1:
            print(0)
        elif n == 2:
            print(2)

        return

    ans = 2
    ans += sum(1 for _ in combinations(range(a, b + 1), n - 2))

    print(ans)


if __name__ == "__main__":
    n, a, b = map(int, input().split())

    main(n, a, b)


Fixed submission:
def main(n: int, a: int, b: int):
    if a > b:
        print(0)
        return

    if n == 1:
        if a == b:
            print(1)
        else:
            print(0)
        return

    if n == 2:
        if a > b:
            print(0)
        else:
            print(1)
        return

    print((n - 2) * (b - a) + 1)


if __name__ == "__main__":
    n, a, b = map(int, input().split())

    main(n, a, b)
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split(' '))

def re_define(input_):
    '''強さ順にする'''
    if input_ == 1:
        return 13
    
    return input_ - 1

A = re_define(A)
B = re_define(B)

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')
p

Fixed submission:
A, B = map(int, input().split(' '))

def re_define(input_):
    '''強さ順にする'''
    if input_ == 1:
        return 13
    
    return input_ - 1

A = re_define(A)
B = re_define(B)

if A > B:
    print('Alice')
elif A < B:
    print('Bob')
else:
    print('Draw')
Buggy python submission (verdict: Runtime Error):
def main(n, t, m, p_x):
    for p, x in p_x:
        _t = t.copy()
        _t[p - 1] = x

        print(sum(_t))


if __name__ == "__main__":
    n = int(input())
    t = list(map(int, input().split()))
    m = int(input())
    p_x = [int(input()) for _ in range(m)]

    main(n, t, m, p_x)


Fixed submission:
def main(n, t, m, p_x):
    for p, x in p_x:
        _t = t.copy()
        _t[p - 1] = x

        print(sum(_t))


if __name__ == "__main__":
    n = int(input())
    t = list(map(int, input().split()))
    m = int(input())
    p_x = [list(map(int, input().split()))
    for _ in range(m)]

    main(n, t, m, p_x)