def sadd(s, sub, sep=' '):
    """Adds sub-string p_sub into p_s, which is a list of sub-strings separated
       by p_sep, and returns the updated string."""
    if not sub:
        return s
    if not s:
        return sub
    elems = set(s.split(sep)).union(set(sub.split(sep)))
    return sep.join(elems)
