def separate(text):
    """
    Process a text to get its parts.

    :param text:
    :return: [head,body,end]
    """
    right = text.rstrip()
    left = text.lstrip()
    return (text[0:-len(left)], text[-len(left):len(right)], text[len(right):])