from hashlib import md5

initial = "abc"
password = [None] * 8
idx = 0

while None in password:
    h = md5(("%s%d" % (initial, idx)).encode()).hexdigest()
    position = h[5]
    if h[:5] == "0" * 5 and position.isdigit() and position < "8":
            position = int(position)
            password[position] = password[position] or h[6]
            print(h, password)

    idx += 1

print("".join(password))

c6bbb2c40bc7981a29db51f2398eaef2f5096b99
<mask token>

<mask token>
while None in password:
    h = md5(('%s%d' % (initial, idx)).encode()).hexdigest()
    position = h[5]
    if h[:5] == '0' * 5 and position.isdigit() and position < '8':
        position = int(position)
        password[position] = password[position] or h[6]
        print(h, password)
    idx += 1
print(''.join(password))

<mask token>
initial = 'abc'
password = [None] * 8
idx = 0
while None in password:
    h = md5(('%s%d' % (initial, idx)).encode()).hexdigest()
    position = h[5]
    if h[:5] == '0' * 5 and position.isdigit() and position < '8':
        position = int(position)
        password[position] = password[position] or h[6]
        print(h, password)
    idx += 1
print(''.join(password))

from hashlib import md5
initial = 'abc'
password = [None] * 8
idx = 0
while None in password:
    h = md5(('%s%d' % (initial, idx)).encode()).hexdigest()
    position = h[5]
    if h[:5] == '0' * 5 and position.isdigit() and position < '8':
        position = int(position)
        password[position] = password[position] or h[6]
        print(h, password)
    idx += 1
print(''.join(password))

from hashlib import md5

initial = "abc"
password = [None] * 8
idx = 0

while None in password:
    h = md5(("%s%d" % (initial, idx)).encode()).hexdigest()
    position = h[5]
    if h[:5] == "0" * 5 and position.isdigit() and position < "8":
            position = int(position)
            password[position] = password[position] or h[6]
            print(h, password)

    idx += 1

print("".join(password))
