Note: When entering space-separated names, use a double space to achieve a single space in the output.