Hi - not sure how the output was decided. Could you explain each of the three cases.