import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Set;
import java.util.TreeSet;

public class Main {
    private static boolean isLetter(char c) {
        return ('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z');
    }

    private static void parseToWords(BufferedReader reader, Set<String> uniqueWords) throws IOException {
        while (reader.ready()) {
            String currentLine = reader.readLine();
            StringBuilder currentWord = new StringBuilder();
            boolean wasLetter = false;
            int lengthLine = currentLine.length();
            for (int i = 0; i < lengthLine; ++i) {
                if (isLetter(currentLine.charAt(i))) {
                    currentWord.append(currentLine.charAt(i));
                    wasLetter = true;
                } else if (wasLetter) {
                    uniqueWords.add(currentWord.toString());
                    currentWord = new StringBuilder();
                    wasLetter = false;
                }
            }
            if (currentWord.length() != 0) {
                uniqueWords.add(currentWord.toString());
            }
        }
    }

    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        Set<String> uniqueWords = new TreeSet<>();
        parseToWords(reader, uniqueWords);
        for (String currentWord : uniqueWords) {
            System.out.println(currentWord);
        }
    }
}