from typing import Set


def split_into_word_set(input_str: str) -> Set[str]:
    """
    >>> sorted(split_into_word_set('  foo    bar      foo  '))
    ['bar', 'foo']
    >>> sorted(split_into_word_set('  foo   \\n  hello    world \\n hello'))
    ['foo', 'hello', 'world']
    """

    items = [s.strip() for s in input_str.strip().split()]
    return set(item for item in items if item)