threesort.py