Remove deleted resources.
Use `sys.stdout.write()` instead of `print()`.