import itertools


def get_leaves(tree):
    """Return leaves of a tree.
    Args: list of lists or string
    Returns: list of strings
    """
    if isinstance(tree, list):
        return list(itertools.chain.from_iterable([get_leaves(subtree) for subtree in tree[1:]]))
    else:
        return [tree]