Additional comments were added to explain the conditions and the print result.