modified:   ch02/greedy.py