Made replace.py more terse.

Reassigned input to raw_input in case of python 2, so I don't have to
repeat the same lines twice.