import re
s = '4of Fo1r pe6ople g3ood th5e the2 7asd 8aaa 9fff 10sad'

res = re.findall(r'\b(\w*?(\d+)\w*?)\b', s)
res.sort(key=lambda x: int(x[1]))
print(' '.join(l[0] for l in res))