I used this code in my other projects, so I just included this one automatically. The reason to replace the stdout is because we can still use `print` instead of `stderr.write`.

But I didn't know that stderr is unbuffered. The solutions I found in StackOverflow usually point to this solution.