def select_sort(lst):
length = len(lst)-1
while length > 1:
imax = 0
imax = max(lst[:length])
indexmax = lst.index(imax)
temp = lst[length]
lst[length] = imax
lst[indexmax] = temp
length -= 1
ZGVmIHNlbGVjdF9zb3J0KGxzdCk6CiAgICBsZW5ndGggPSBsZW4obHN0KS0xCiAgICB3aGlsZSBsZW5ndGggPiAxOgogICAgICAgIGltYXggPSAwCiAgICAgICAgaW1heCA9IG1heChsc3RbOmxlbmd0aF0pCiAgICAgICAgaW5kZXhtYXggPSBsc3QuaW5kZXgoaW1heCkKICAgICAgICB0ZW1wID0gbHN0W2xlbmd0aF0KICAgICAgICBsc3RbbGVuZ3RoXSA9IGltYXgKICAgICAgICBsc3RbaW5kZXhtYXhdID0gdGVtcAogICAgICAgIGxlbmd0aCAtPSAx