Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(100000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = []

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x):
            x.append(water)

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            continue
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])


Fixed submission:
import sys
sys.setrecursionlimit(100000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = [0,0]

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x and water!=0):
            x.append(water)

ans[0]=x[0]

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            continue
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])

Buggy python submission (verdict: Runtime Error):
import sys
sys.setrecursionlimit(1000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = []

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x):
            x.append(water)

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            break
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])


Fixed submission:
import sys
sys.setrecursionlimit(100000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = [0,0]

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x and water!=0):
            x.append(water)

ans[0]=x[0]

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            continue
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])

Buggy python submission (verdict: Runtime Error):
A,B,C,D,E,F = [int(x) for x in input().split()]
#%%
x = []
y = []
ans_max = 0
ans = []

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x):
            x.append(water)

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            break
        elif(100*j < i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])


Fixed submission:
import sys
sys.setrecursionlimit(100000000)
A,B,C,D,E,F = [int(x) for x in input().split()]

x = []
y = []
ans_max = 0
ans = [0,0]

for i in range(F//(100*A)+1):
    for j in range((F-100*A*i)//(100*B)+1):
        water = 100*(A*i+B*j)
        if(water<=F and not water in x and water!=0):
            x.append(water)

ans[0]=x[0]

for i in range(F):
    for j in range(F):
        salt = C*i+D*j
        if(salt<=F and not salt in y):
            y.append(salt)

for i in x:
    for j in y:
        if(i==0):
            continue
        elif(100*j <= i*E and i+j <= F):
            percent = 100*j/(i+j)
            if(ans_max < percent):
                ans_max = percent
                ans = [i,j]

print(sum(ans),ans[1])