The program for the same in python is as follows :
#This gets the count of names to be input
count = int(input("Total names: "))
#This initializes the list of names
names = []
#This iteration gets all names
for i in range(count):
#This gets a name
name = input("Enter a name: ")
#This appends it to the list
names.append(name)
#This sorts the name
names.sort()
#This prints the first and the last name, alphabetically
print(names[0] + " " + names[-1])
Learn more about such codes here https://brainly.com/question/22654163
#SPJ10