Factor code into function print_names_ages_reversed()