Buggy python submission (verdict: Runtime Error):
S = input()

S[0:4] = '2018'
print(S)

Fixed submission:
S = input()

print('2018' + S[4:])

Buggy python submission (verdict: Runtime Error):
from numba import jit
N, Y = map(int, input().split())

count_max = Y / 1000  # all 1000

@jit
def sample(n, y):
    ans = '-1 -1 -1'
    for i in reversed(range(y // 10000 + 1)):
        count_tmp1 = count_max - 9 * i
        price_tmp1 = y - 10000 * i
        if count_tmp1 < n or price_tmp1 < 0:
            continue

        if count_tmp1 == n:
            ans = '{} {} {}'.format(i, 0, N - i)
            return ans

        if price_tmp1 > 5000 * count_tmp1:
            return ans

        for j in reversed(range(price_tmp1 // 5000 + 1)):
            count_tmp2 = count_tmp1 - 4 * j
            price_tmp2 = price_tmp1 - 5000 * j
            if count_tmp2 < n or price_tmp2 < 0:
                continue
            if count_tmp2 == n:
                ans = '{} {} {}'.format(i, j, N - i -j)
                return ans
            if price_tmp2 > 5000 * count_tmp2:
                return ans
    return ans
a = sample(N, Y)
print(a)

Fixed submission:
S = input()

print('2018' + S[4:])

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())

ans = '-1 -1 -1'
count_max = Y / 1000  # all 1000

if (Y % 10000 == 0) and (Y // 10000 == N):
    print('{} 0 0'.format(Y//10000))
    exit()


for i in reversed(range(Y // 10000)):
    count_tmp1 = count_max - 9 * i
    price_tmp1 = Y - 10000 * i
    if count_tmp1 < N or price_tmp1 < 0:
        continue

    if count_tmp1 == N:
        ans = '{} {} {}'.format(i, 0, N - i)
        #ans_list.append(ans)
        break

    if (price_tmp1 % 5000 == 0) and ((price_tmp1 // 5000 + count_tmp1) == N):
        ans = '{} {} {}'.format(i, price_tmp1 // 5000, 0)
        break

    is_continue = True
    for j in reversed(range(price_tmp1 // 5000)):
        count_tmp2 = count_tmp1 - 4 * j
        price_tmp2 = price_tmp1 - 5000 * j
        if count_tmp2 < N or price_tmp2 < 0:
            continue
        if count_tmp2 == N:
            ans = '{} {} {}'.format(i, j, N - i -j)
            is_continue = False
            break
    if not is_continue:
        break
print(ans)

Fixed submission:
S = input()

print('2018' + S[4:])

Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())

ans = '-1 -1 -1'
count_max = Y / 1000  # all 1000

if Y % 10000 == 0:
    print('{} 0 0'.format(Y//10000))
    exit()


for i in reversed(range(Y // 10000)):
    count_tmp1 = count_max - 9 * i
    price_tmp1 = Y - 10000 * i
    if count_tmp1 < N or price_tmp1 < 0:
        continue

    if count_tmp1 == N:
        ans = '{} {} {}'.format(i, 0, N - i)
        #ans_list.append(ans)
        break

    if price_tmp1 % 5000 == 0:
        ans = '{} {} {}'.format(i, price_tmp1 // 5000, 0)
        break

    is_continue = True
    for j in reversed(range(price_tmp1 // 5000)):
        count_tmp2 = count_tmp1 - 4 * j
        price_tmp2 = price_tmp1 - 5000 * j
        if count_tmp2 < N or price_tmp2 < 0:
            continue
        if count_tmp2 == N:
            ans = '{} {} {}'.format(i, j, N - i -j)
            is_continue = False
            break
    if not is_continue:
        break
print(ans)

Fixed submission:
S = input()

print('2018' + S[4:])