Added extract.py along with input.txt.

Added my code to complete your specified task under extract.py. I also included a version of the input file on which to run extract.py. Let me know if this isn't what you want or if you'd like some different functionality.