def main():
    # Prompt the user to enter filenames
    f1 = input("Enter a filename: ").strip()

    # Open files for input 
    infile = open(f1, "r")
    
    s = infile.read() # Read all from the file
    infile.close()
    
    words = s.split()
    nonduplicateWords = set(words)
    words = list(nonduplicateWords)
    words.sort()
    
    for word in words:
        print(word, end = " ") 

main()

71afcbf46ee4d4e24eb7372c20480b254d9cf555
<mask token>

def main():
    f1 = input('Enter a filename: ').strip()
    infile = open(f1, 'r')
    s = infile.read()
    infile.close()
    words = s.split()
    nonduplicateWords = set(words)
    words = list(nonduplicateWords)
    words.sort()
    for word in words:
        print(word, end=' ')


<mask token>

def main():
    f1 = input('Enter a filename: ').strip()
    infile = open(f1, 'r')
    s = infile.read()
    infile.close()
    words = s.split()
    nonduplicateWords = set(words)
    words = list(nonduplicateWords)
    words.sort()
    for word in words:
        print(word, end=' ')


main()

def main():
    # Prompt the user to enter filenames
    f1 = input("Enter a filename: ").strip()

    # Open files for input 
    infile = open(f1, "r")
    
    s = infile.read() # Read all from the file
    infile.close()
    
    words = s.split()
    nonduplicateWords = set(words)
    words = list(nonduplicateWords)
    words.sort()
    
    for word in words:
        print(word, end = " ") 

main()
