Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if 10000 * i + 5000 * j +1000(n-i-j) == y:
            print(i, j, n-i-j)
            exit() 
print("-1 -1 -1")

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

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

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if 10000 * i + 5000 * j +1000(n-i-j) == y:
            print(i, j, n-i-j)
        exit() 
print("-1 -1 -1")

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

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

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if (10000*i + 5000*j +1000(n-i-j)) == y:
            print(i, j, n-i-j)
            exit() 
print("-1 -1 -1")

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

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

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if (10000*i + 5000*j +1000(n-i-j)) == y:
            print(i, j, n-i-j)
            exit() 
print("-1 -1 -1")

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

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

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
for i in range(n+1):
    for j in range(n-i+1):
        if (10000*i + 5000*j +1000(n-i-j)) == y:
            print(i, j, n-i-j)
            exit()
        else:
            print("-1 -1 -1")

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

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

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
ans = 0
for i in range(n+1):
    for j in range(n-i+1):
        if (10000*i + 5000*j +1000(n-i-j)) ==y:
            print(i, j, n-i-j)
            exit()
        else:
            print('-1 -1 -1')

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

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

Buggy python submission (verdict: Runtime Error):
n, y = map(int, input().split())
ans = 0
for i in range(n+1):
    for j in range(n-i+1):
        if (10000*i + 5000*j +1000(n-i-j)) ==y:
            print(i, j, n-i-j)
        else:
            print('-1 -1 -1')

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

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