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

N = l[0]
Y = l[1]
ans = [-1,-1,-1]

if Y/10000 < N:
    for i in range(int(Y/10000)+1):
        a = i
        n = N - a
        Y1 = Y - (a * 10000)
        if Y1/5000 < n:
            for j in range(int(Y1/5000)+1):
                b = j
                c = n - j
                if 10000 * a + 5000 * b + 1000 * c == Y:
                    ans = [a,b,c]

print(" ".join(ans))


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

N = l[0]
Y = l[1]
ans = [-1,-1,-1]

if Y/10000 <= N:
    for i in range(int(Y/10000)+1):
        a = i
        n = N - a
        Y1 = Y - (a * 10000)
        if Y1/5000 <= n:
            for j in range(int(Y1/5000)+1):
                b = j
                c = n - j
                if 10000 * a + 5000 * b + 1000 * c == Y:
                    ans = [a,b,c]

print(ans[0],ans[1],ans[2])

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))                     
                                                        
N = l[0]                                                
Y = l[1]                                                
ans = [-1,-1,-1]                                        
                                                        
if Y/10000 < N:                                         
    for i in range(int(Y/10000)+1):                     
a = i                                           
n = N - a                                       
Y1 = Y - (a * 10000)                            
if Y1/5000 < n:                                 
for j in range(int(Y1/5000)+1):             
b = j                                   
c = n - j                               
if 10000 * a + 5000 * b + 1000 * c == Y:
ans = [a,b,c]                       
                                                        
print(ans)

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

N = l[0]
Y = l[1]
ans = [-1,-1,-1]

if Y/10000 <= N:
    for i in range(int(Y/10000)+1):
        a = i
        n = N - a
        Y1 = Y - (a * 10000)
        if Y1/5000 <= n:
            for j in range(int(Y1/5000)+1):
                b = j
                c = n - j
                if 10000 * a + 5000 * b + 1000 * c == Y:
                    ans = [a,b,c]

print(ans[0],ans[1],ans[2])

Buggy python submission (verdict: Runtime Error):
l = list(map(int, input().split()))                     
                                                        
N = l[0]                                                
Y = l[1]                                                
ans = [-1,-1,-1]                                        
                                                        
if Y/10000 < N:                                         
    for i in range(int(Y/10000)+1):                     
    ¦   a = i                                           
    ¦   n = N - a                                       
    ¦   Y1 = Y - (a * 10000)                            
    ¦   if Y1/5000 < n:                                 
    ¦   ¦   for j in range(int(Y1/5000)+1):             
    ¦   ¦   ¦   b = j                                   
    ¦   ¦   ¦   c = n - j                               
    ¦   ¦   ¦   if 10000 * a + 5000 * b + 1000 * c == Y:
    ¦   ¦   ¦   ¦   ans = [a,b,c]                       
                                                        
print(ans)                                              

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

N = l[0]
Y = l[1]
ans = [-1,-1,-1]

if Y/10000 <= N:
    for i in range(int(Y/10000)+1):
        a = i
        n = N - a
        Y1 = Y - (a * 10000)
        if Y1/5000 <= n:
            for j in range(int(Y1/5000)+1):
                b = j
                c = n - j
                if 10000 * a + 5000 * b + 1000 * c == Y:
                    ans = [a,b,c]

print(ans[0],ans[1],ans[2])