Here are the logs after running the following programs.