def min_select(inputA):
    smallest = inputA[0]
    for element in inputA:
        if element < smallest:
            smallest = element
            
    return smallest


def min_sort(items):
    cache = []
    while items:
        smallest = min_select(items)
        cache.append(smallest)
        items.remove(smallest)
        
    return cache
    
work = []
count = int(input('How many names to enter: '))
while count:
    name = input('Enter a name: ')
    work.append(name)
    count -= 1
final = min_sort(work)
print(final)
