Buggy python submission (verdict: Runtime Error):
while True:
    e = int(raw_input())
 
    if e == 0:
        break

    ans = float('inf')

    for z in range(10**2+1):
        for y in range(10**3+1):
            if y**2 + z**3 <= e:
                x = e - y**2 - z**3
                ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
while True:
    e = int(raw_input())
 
    if e == 0:
        break

    ans = 1e8

    for z in range(10**2+1):
        for y in range(10**3+1):
            if y**2 + z**3 <= e:
                x = e - y**2 - z**3
                ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
while True:
    e = int(raw_input())
 
    if e == 0: break

    ans = 1e8

    for z in range(10**2+1):
        for y in range(10**3+1):
            if y**2 + z**3 > e:
                break
            x = e - y**2 - z**3
            ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
while True:
    e = int(raw_input())
 
    if e == 0: break

    ans = 1e8

    x, y, z = 0, 0, 0

    for z in range(e):
        if z**3 > e: break
        for y in range(e):
            if y**2 + z**3 > e: break
            x = e - y**2 - z**3
            ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
while True:
    e = int(raw_input())
 
    if e == 0: break

    x, y, z, ans = 0, 0, 0, e

    for z in range(e):
        if z**3 > e: break
        for y in range(e):
            if y**2 + z**3 > e: break
            x = e - y**2 - z**3
            ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
from math import sqrt

while True:
    e = int(raw_input())
 
    if e == 0: break

    x, y, z, ans = 0, 0, 0, e

    for z in range(e):
        if z**3 > e: break
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
from math import sqrt
 
while True:
    e = int(raw_input())
  
    if e == 0: break
 
    x, y, z, ans = 0, 0, 0, e
 
    for z in range(e+1):
        if z**3 > e: break
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x+y+z)
 
    print ans


Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
from math import sqrt

while True:
    e = int(raw_input())

    if e == 0: break

    z, ans = 0, e

    for z in range(e+1):
        if z**3 > e: break
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)

Buggy python submission (verdict: Runtime Error):
from math import sqrt

while True:
    e = int(raw_input())
    if e == 0: break

    ans = e

    for z in range(e):
        if z**3 > e: break
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x+y+z)

    print ans



Fixed submission:
#!/usr/bin/env python3

from math import sqrt

while True:
    e = int(input())

    if e == 0: break
    z, ans = 0, e

    while z ** 3 <= e:
        y = int(sqrt(e - z**3))
        x = e - y**2 - z**3
        ans = min(ans, x + y + z)
        z += 1

    print(ans)