Updated to Python 3.

In order to preserve compatibility with Python 2, raw_input was preserved.