<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def print_and_exit(results):
 """Print each result and stop the reactor."""

    for success, value in results:
        if success:
            print value.encode(locale.getpreferredencoding())
        else:
            value.printTraceback()