Mock stdout and change function name input

As a suggestion, mock the stdout in Python unittests.

Mock is part of the Python unittest library starting from version 3.3. For any previous Python versions it can be installed with pip, for example ```pip install mock```.

Function name ```input``` needs to be changed because [input()](http://docs.python.org/2/library/functions.html#input) is a reserved name in Python. I propose to change it to murenzhuang.

P.S. Good work! I enjoyed the exercise. :+1: