Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
print(0)
check = readline().rstrip().decode()
if check == 'Vacant':
    exit()
print(n - 1)
memo = readline().rstrip().decode()
if memo == 'Vacant':
    exit()
low = 0
high = n - 1
while low + 1 < high:
    mid = (low + high) // 2
    print(mid)
    s = readline().rstrip().decode()
    if s == 'Vacant':
        exit()
    if (mid - low) % 2:
        if check == s:
            high = mid
        else:
            check = s
            high = mid
    else:
        if check != s:
            low = mid
            check = s
        else:
            high = mid


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())


def q(i):
    print(i)
    r = input()[0]
    if r == 'V':
        exit()
    return r


z = q(0)


def is_ok(k):
    s = q(k)
    if k % 2:
        return z != s
    else:
        return z == s


ok = 0
ng = n
while ng - ok > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())
print(0)
s = readline().rstrip().decode()
if s == 'Vacant':
    exit()
check = s
print(n - 1)
s = readline().rstrip().decode()
if s == 'Vacant':
    exit()
low = 0
high = n - 1
while low + 1 < high:
    mid = (low + high) // 2
    print(mid)
    s = readline().rstrip().decode()
    if s == 'Vacant':
        exit()
    if mid % 2 == 0:
        if check == s:
            low = mid
        else:
            check = s
            high = mid
    else:
        if check != s:
            low = mid
        else:
            check = s
            high = mid


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n = int(readline())


def q(i):
    print(i)
    r = input()[0]
    if r == 'V':
        exit()
    return r


z = q(0)


def is_ok(k):
    s = q(k)
    if k % 2:
        return z != s
    else:
        return z == s


ok = 0
ng = n
while ng - ok > 1:
    m = (ok + ng) // 2
    if is_ok(m):
        ok = m
    else:
        ng = m
Buggy python submission (verdict: Runtime Error):
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

n = input()
if n.count('0') >= or n.count('1') >= 3 or n.count('2') >= 3 or n.count('3') >= 3 or n.count('4') >= 3 or n.count('5') >= 3 or n.count('6') >= 3 or n.count('7') >= 3 or n.count('8') >= 3 or n.count('9'):
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Fixed submission:
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

n = input()
if '000' in n or '111' in n or '222' in n or '333' in n or '444' in n or '555' in n or '666' in n or '777' in n or '888' in n or '999' in n:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
Buggy python submission (verdict: Runtime Error):
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

x, y = map(input().split())
hex_x = int(x, 16)
hex_y = int(y, 16)
if hex_x > hex_y:
    ans = '>'
elif hex_x < hex_y:
    ans = '<'
else:
    ans = '='
print(ans)

Fixed submission:
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

x, y = input().split()
hex_x = int(x, 16)
hex_y = int(y, 16)
if hex_x > hex_y:
    ans = '>'
elif hex_x < hex_y:
    ans = '<'
else:
    ans = '='
print(ans)

Buggy python submission (verdict: Runtime Error):
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

x, y = map(int, input().split())
hex_x = int(x, 16)
hex_y = int(y, 16)
if hex_x > hex_y:
    ans = '>'
elif hex_x < hex_y:
    ans = '<'
else:
    ans = '='
print(ans)

Fixed submission:
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

x, y = input().split()
hex_x = int(x, 16)
hex_y = int(y, 16)
if hex_x > hex_y:
    ans = '>'
elif hex_x < hex_y:
    ans = '<'
else:
    ans = '='
print(ans)
Buggy python submission (verdict: Runtime Error):
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

bcd = input()
efg = input()
if b == g and c == f and d == e:
    ans = 'Yes'
else:
    ans = 'No'
print(ans)

Fixed submission:
# sys.stdin.readline()
import sys
import math
input = sys.stdin.readline

a = input()
b = input()
if (a[0] in b[2]) and (a[1] in b[1]) and (a[2] in b[0]):
    ans = 'YES'
else:
    ans = 'NO'
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
import bisect
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
cnt = 0

for i in range(n):
    if a[i] > b[n - 1]:
        break
    insert_index_b = bisect.bisect_right(b, a[i])  # 昇順
    for j in range(insert_index_b, n):
        insert_index_c = bisect.bisect_right(c, b[j])
        cnt += n - insert_index_c

print(cnt)


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

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
cnt = 0
ans = 0
memo = [0] * n

for i in range(n):
    insert_index_c = bisect.bisect_right(c, b[i])
    cnt += n - insert_index_c
    memo[i] += cnt

for i in range(n):
    if a[i] > b[n - 1]:
        break
    insert_index_b = bisect.bisect_right(b, a[i])  # 昇順
    if insert_index_b >= 1:
        ans += memo[n - 1] - memo[insert_index_b - 1]
    else:
        ans += memo[n - insert_index_b - 1]

print(ans)

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

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
b.sort()
c.sort()
cnt = 0

for i in range(n):
    insert_index_b = bisect.bisect_right(b, a[i])  # 昇順
    for j in range(insert_index_b, n):
        insert_index_c = bisect.bisect_right(c, b[j])
        cnt += n - insert_index_c

print(cnt)


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

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
a.sort()
b.sort()
c.sort()
cnt = 0
ans = 0
memo = [0] * n

for i in range(n):
    insert_index_c = bisect.bisect_right(c, b[i])
    cnt += n - insert_index_c
    memo[i] += cnt

for i in range(n):
    if a[i] > b[n - 1]:
        break
    insert_index_b = bisect.bisect_right(b, a[i])  # 昇順
    if insert_index_b >= 1:
        ans += memo[n - 1] - memo[insert_index_b - 1]
    else:
        ans += memo[n - insert_index_b - 1]

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

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
cnt = 0
a.sort();b.sort();c.sort()
for i in range(n):
    for j in range(n):
        if a[i] < b[j]:
            for k in range(n):
                if b[j] < c[k]:
                    cnt += n-k
                    break
print(cnt)

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

n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))
cnt = 0
a.sort()
c.sort()
for i in range(n):
    cnt += (bisect.bisect_left(a, b[i])) * (n-bisect.bisect_right(c, b[i]))
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
xy = [list(map(int, readline().split())) for _ in range(n)]
ans = float('inf')
for i, (ix, _) in enumerate(xy):
    for jx, _ in xy[i + 1:]:
        for j, (_, iy) in enumerate(xy):
            for _, jy in xy[j + 1:]:
                cnt = 0
                for x, y in xy:
                    if (ix <= x <= jx or jx <= x <= ix) and (iy <= y <= jy or jy <= y <= iy):
                        cnt += 1
                if cnt >= k:
                    ans = min(ans, abs(jx - ix) * abs(jy - iy))
print(ans)


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
xy = []
xx = []
yy = []
for _ in range(n):
    x, y = map(int, readline().split())
    xx.append(x)
    yy.append(y)
    xy.append((x, y))
xx.sort()
yy.sort()
ans = float('inf')
for i, ix in enumerate(xx):
    for jx in xx[i + 1:]:
        for j, iy in enumerate(yy):
            for jy in yy[j + 1:]:
                cnt = 0
                for x, y in xy:
                    if ix <= x <= jx and iy <= y <= jy:
                        cnt += 1
                if cnt >= k:
                    ans = min(ans, (jx - ix) * (jy - iy))
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
xy = [list(map(int, readline().split())) for _ in range(n)]
ans = float('inf')
for i, (ix, _) in enumerate(xy):
    for jx, _ in xy[i + 1:]:
        for j, (_, iy) in enumerate(xy):
            for _, jy in xy[j + 1:]:
                cnt = 0
                for x, y in xy:
                    if (ix <= x <= jx or jx <= x <= ix) and (iy <= y <= jy or jy <= y <= iy):
                        cnt += 1
                if cnt >= k:
                    ans = min(ans, abs(jx - ix) * abs(jy - iy))
print(ans)


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, k = map(int, readline().split())
xy = []
xx = []
yy = []
for _ in range(n):
    x, y = map(int, readline().split())
    xx.append(x)
    yy.append(y)
    xy.append((x, y))
xx.sort()
yy.sort()
ans = float('inf')
for i, ix in enumerate(xx):
    for jx in xx[i + 1:]:
        for j, iy in enumerate(yy):
            for jy in yy[j + 1:]:
                cnt = 0
                for x, y in xy:
                    if ix <= x <= jx and iy <= y <= jy:
                        cnt += 1
                if cnt >= k:
                    ans = min(ans, (jx - ix) * (jy - iy))
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import floyd_warshall

n = int(readline())
memo_graph = [list(map(int, readline().split())) for _ in range(n)]
cost = floyd_warshall(csr_matrix(memo_graph))
cnt_1 = 0
cnt_2 = 0
for i in range(n):
    for j in range(n):
        if int(cost[i][j]) != memo_graph[i][j]:
            print(-1)
            exit()
        if cost[i][j] == 0:
            continue
        cnt_1 += cost[i][j]
s = set()
for k in range(n):
    for i in range(n):
        for j in range(n):
            # 3頂点が異なってかつ、経由のが近い場合は直接の辺は不要
            if i != j and j != k and k != i and cost[i][k] + cost[k][j] == cost[i][j]:
                if (i, j) not in s:
                    s.add((i, j))
                    cnt_2 += cost[i][j]
print((cnt_1 - cnt_2) // 2)


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

import numpy as np

n = int(readline())
graph = np.array([list(map(int, readline().split())) for _ in range(n)])
inf = 10 ** 10
ans = 0
for i in range(n):
    graph[i][i] = inf
for i in range(n):
    for j in range(i + 1, n):
        v = np.min(graph[i] + graph[j])
        if graph[i][j] > v:
            print(-1)
            exit()
        elif graph[i][j] < v:
            ans += graph[i][j]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
import sys
input = sys.stdin.readline

n = int(input())
A = [0]*n
A[0] = int(input())
for i in range(1,n):
    a = int(input())
    if a in A:
        A.remove(a)
    else:
        A[i] = a
print(len(set(A))-1)

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

n = int(input())
a = [0]*n
ans = 0
for i in range(n):
    a[i] = int(input())
count_a = collections.Counter(a).most_common()
for i in range(len(count_a)):
    if count_a[i][1]%2 != 0:
        ans += 1
print(ans)

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

n = int(input())
A = [int(input())]
for i in range(n-1):
    a = int(input())
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))


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

n = int(input())
a = [0]*n
ans = 0
for i in range(n):
    a[i] = int(input())
count_a = collections.Counter(a).most_common()
for i in range(len(count_a)):
    if count_a[i][1]%2 != 0:
        ans += 1
print(ans)

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

n = int(input())
A = [int(input())]
for i in range(n-1):
    a = int(input())
    if a in A:
        A.remove(a)
    else:
        A.append(a)
print(len(A))

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

n = int(input())
a = [0]*n
ans = 0
for i in range(n):
    a[i] = int(input())
count_a = collections.Counter(a).most_common()
for i in range(len(count_a)):
    if count_a[i][1]%2 != 0:
        ans += 1
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys

s = list(input())
set_s = set(s)
new_s = list(set_s)
new_s.sort()
for i in range(26):
    if ord(new_s[i]) != 97+i:
        print(chr(97+i))
        sys.exit()
print('None')

Fixed submission:
import sys

s = list(input())
set_s = set(s)
new_s = list(set_s)
new_s.sort()
for i in range(26):
    if ord(new_s[i]) != 97+i:
        print(chr(97+i))
        sys.exit()
    if len(new_s) == i+1:
        if i == 25:
            break
        print(chr(98+i))
        sys.exit()
print('None')
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

n = int(input())
a = list(map(int, input().split()))
cnt = 0
check = 0
ans = 1

a.sort(reverse=True)
for i in range(n - 1):
    if a[cnt] == a[cnt + 1]:
        cnt += 2
        check += 1
        ans *= a[cnt]
        if check == 2:
            print(ans)
            exit()
    else:
        cnt += 1

    if cnt == n - 1:
        break
print(0)


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

n = int(input())
a = list(map(int, input().split()))
cnt = 0
check = 0
ans = 1

a.sort(reverse=True)
for i in range(n - 1):
    if a[cnt] == a[cnt + 1]:
        check += 1
        ans *= a[cnt]
        cnt += 2
        if check == 2:
            print(ans)
            exit()
    else:
        cnt += 1

    if cnt == n - 1:
        break
print(0)
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from math import gcd

n = int(readline())
t = [int(readline()) for _ in range(n)]
ans = t[0]
for tt in t:
    ans = ans * tt // gcd(ans, tt)
print(ans)


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

n = int(input())
t = int(input())
ans = t
for i in range(1, n):
    t = int(input())
    ans = ans * t//fractions.gcd(ans, t)
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, p, *a = map(int, read().split())
cnt_1 = 0
cnt_2 = 0
for i in a:
    if a[i] % 2 == 1:
        cnt_1 += 1
    else:
        cnt_2 += 1
ans = 2 ** max(0, cnt_1 - 1) * 2 ** cnt_2
if p == 1 and cnt_1 == 0:
    ans = 0
print(ans)


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

n, p = map(int, readline().split())
a = list(map(int, readline().split()))
cnt_1 = 0
cnt_2 = 0
for i in a:
    if i % 2 == 1:
        cnt_1 += 1
    else:
        cnt_2 += 1
ans = 2 ** max(0, cnt_1 - 1) * 2 ** cnt_2
if p == 1 and cnt_1 == 0:
    ans = 0
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

a, b, c = map(int, input().split())
if a <= c and b >= c:
    ans = 'Yes'
else
    ans = 'No'
print(ans)

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

a, b, c = map(int, input().split())
if (a <= c) and (b >= c):
    ans = 'Yes'
else:
    ans = 'No'
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

a, b, c = map(nt, input().split())
for i in range(1, b):
    if (a*i)%b == c:
        print('YES')
        sys.exit()
print('NO')

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

a, b, c = map(int, input().split())
for i in range(1, b):
    if (a*i)%b == c:
        print('YES')
        sys.exit()
print('NO')
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter
input = sys.stdin.readline

n = int(input())
s = []
memo = []
ans = ''
for i in range(n):
    s.append(list(input().rstrip('\n')))
    s[i].sort()
    memo.append(list(Counter(s[i]).items()))
for i in range(1, n):
    check = [0] * len(memo[0])
    cnt = 0
    for j in range(len(memo[0])):
        if len(memo[i]) == cnt:
            continue
        memo[i][cnt] = list(memo[i][cnt])
        if memo[0][j][0] == memo[i][cnt][0]:
            if memo[0][j][1] > memo[i][cnt][1]:
                memo[0][j][1] = memo[i][cnt][1]
            cnt += 1
            check[j] = 1
        if check[j] == 0:
            memo[0][j] = list(memo[0][j])
            memo[0][j][1] = 0

for i in range(len(memo[0])):
    for j in range(memo[0][i][1]):
        ans += memo[0][i][0]
print(ans)


Fixed submission:
import sys
from collections import Counter
input = sys.stdin.readline

n = int(input())
s = []
memo = []
ans = ''
check = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
check_cnt = [50] * 26
for i in range(n):
    s.append(list(input().rstrip('\n')))
    s[i].sort()
    memo.append(list(Counter(s[i]).items()))

for i in range(n):
    for check_m in range(26):
        flg = False
        for j in range(len(memo[i])):
            if check[check_m] == memo[i][j][0]:
                if check_cnt[check_m] > memo[i][j][1]:
                    check_cnt[check_m] = memo[i][j][1]
                flg = True
                break
        if flg:
            continue
        else:
            check_cnt[check_m] = 0

for i in range(26):
    for j in range(check_cnt[i]):
        ans += check[i]
print(ans)
Buggy python submission (verdict: Runtime Error):
import math

def xv(num):
    return 2 * math.floor(0.5 * num)

a = list(map(int, input().split()))
ans = 0

Que = xv(a[0]) + xv(a[3]) + xv(a[4])

if (a[3] or a[4]) == 0:
    pass
else:
    a[0] = a[0] - 1
    a[3] = a[3] - 1
    a[4] = a[4] - 1

    Qae = 3 + xv(a[0]) + xv(a[3]) + xv(a[4])

ans = ans + a[1] + max(Que,Qae)
print(ans)

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

ans = a[1] + 2*(a[0]//2 + a[4]//2 + a[3]//2)
if a[0]>0 and a[3]>0 and a[4]>0:
  ans = max(ans, a[1] + 2*((a[0]-1)//2 + (a[3]-1)//2 + (a[4]-1)//2) + 3)
  
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
ans = 'CODEFESTIVAL2016'
cnt = 0
for i in range(n):
  if s[i] != ans[i]:
    cnt += 1
print(cnt)


Fixed submission:
s = input()
ans = 'CODEFESTIVAL2016'
cnt = 0
for i in range(len(s)):
  if s[i] != ans[i]:
    cnt += 1
print(cnt)

Buggy python submission (verdict: Runtime Error):
s = input()
ans = 'CODEFESTIVAL2016'
cnt = 0
for i in range(n):
  if s[i] = != ans[i]:
    cnt += 1
print(cnt)


Fixed submission:
s = input()
ans = 'CODEFESTIVAL2016'
cnt = 0
for i in range(len(s)):
  if s[i] != ans[i]:
    cnt += 1
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
x = input()
for i in range(2*10**5):
    if 'ST' not in x:
        break
    x = x.replace('ST', '')
print(len(x))

Fixed submission:
x = input()
x = x[::-1]
cnt = 0
for i in range(len(x)):
    if 'S' in x[i]:
        if cnt != 0:
            cnt -= 2
    else:
        cnt += 2
print(cnt)
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = input()
k = int(input())
al = [chr(ord('a') + i) for i in range(26)]
ans = ''
for i in range(len(s)):
    num = al.index(s[i])
    if 26 - num <= k:
        k -= 26 - num
        if i != len(s) - 1:
            ans += 'a'
        else:
            ans += al[k]
    else:
        if i != len(s) - 1:
            ans += s[i]
        else:
            ans += al[num + k]
print(ans)


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

s = list(input())
k = int(input())
for i in range(len(s)):
    num = (ord('z') - ord(s[i]) + 1) % 26
    if num <= k:
        k -= num
        s[i] = 'a'
s[-1] = chr((ord(s[-1]) - ord('a') + k) % 26 + ord('a'))
print(*s, sep='')
Buggy python submission (verdict: Runtime Error):
print((int(readline()) + int(readline())) * int(readline()) // 2)


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

a = int(input())
b = int(input())
h = int(input())
ans = (a+b) * h * 0.5
print(int(ans))
Buggy python submission (verdict: Runtime Error):
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from itertools import product

s = read().rstrip().decode()
ans = 0
for bit in product(['', '+'], repeat=len(s) - 1):
    memo = 0
    for i, (bf, af) in enumerate(zip(s, s[1:])):
        memo += int(bf)
        if bit[i] == '+':
            ans += memo
            memo = 0
        else:
            memo *= 10
    memo += int(af)
    ans += memo
print(ans)


Fixed submission:
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)

from itertools import product

s = read().rstrip().decode()
ans = int(s[-1]) * (2 ** (len(s) - 1))
for bit in product(['', '+'], repeat=len(s) - 1):
    memo = 0
    for i, (bf, af) in enumerate(zip(s, s[1:])):
        memo += int(bf)
        if bit[i] == '+':
            ans += memo
            memo = 0
        else:
            memo *= 10
    ans += memo
print(ans)
Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

a, b = map(int, input().split())
if a <= 0:
    if b >= 0:
        ans = 'Zero'
    elif b < 0 and (b-a+1)%2 == 1:
        ans = 'Negative'
else:
    ans = 'Positive'
print(ans)

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

a, b = map(int, input().split())
if a <= 0:
    if b >= 0:
        ans = 'Zero'
    elif b < 0 and (b-a)%2 == 0:
        ans = 'Negative'
    else:
        ans = 'Positive'
else:
    ans = 'Positive'
print(ans)

Buggy python submission (verdict: Runtime Error):
import sys
input = sys.stdin.readline

a, b = map(int, input().split())
if a <= 0:
    if b >= 0:
        ans = 'Zero'
    elif b < 0 and (b-a)%2 == 0:
        ans = 'Negative'
else:
    ans = 'Positive'
print(ans)

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

a, b = map(int, input().split())
if a <= 0:
    if b >= 0:
        ans = 'Zero'
    elif b < 0 and (b-a)%2 == 0:
        ans = 'Negative'
    else:
        ans = 'Positive'
else:
    ans = 'Positive'
print(ans)