def sort_key(string):
    """
    Function returning sort value for the strings in PassJoin algorithm. It
    basically order them by decreasing length, then alphabetically as per
    the "4.2 Effective Indexing Strategy" point of the paper.
    """
    return -len(string), string