def predict_next_words(
        probability_matrix: dict[str, dict[str, float]],
        initial_words: list[str],
        num_words: int
    ) -> list[str]:
    """
    Predict the next words in a phrase using a given probability matrix.
    Start from the last initial word. At each step, choose the next word with
    the highest probability. For equal probabilities, choose the word that
    appears first in the corresponding dictionary.

    Parameters
    ----------
    probability_matrix : dict[str, dict[str, float]]
        A dictionary where each key is a word and its value is another
        dictionary mapping subsequent words to probabilities.
    initial_words : list[str]
        The initial words of the phrase, containing at least one word.
    num_words : int
        The nonnegative number of words to predict.

    Returns
    -------
    list[str]
        The predicted `num_words` following the initial words.
        If no next word is found, the prediction stops.

    Examples
    --------
    >>> prob_matrix = {
    ...     "I": {"am": 0.5, "have": 0.5},
    ...     "am": {"a": 1.0},
    ...     "a": {"developer": 0.6, "designer": 0.4}
    ... }
    >>> predict_next_words(prob_matrix, ["I"], 3)
    ['am', 'a', 'developer']
    """
    raise NotImplementedError("Complete this function.")
