def collect_alphabets(cooccs):
    """
    Return the `x` and `y` alphabets from a list of co-occurrences.

    :param list cooccs: The list of co-occurrence tuples.

    :return tuple alphabets: A tuple of two elements, the sorted list of
        symbols in series `x` and the sorted list of symbols in series `y`.
    """

    alphabet_x, alphabet_y = zip(*cooccs)

    return sorted(set(alphabet_x)), sorted(set(alphabet_y))