import logging


def split(pattern, lyrics):
    """Split Binasphere lines.

    Args:
        pattern: List of integers indicating join pattern.
        lyrics: String to split.

    >>> split([0, 1, 1], 'a b c d e f')
    ['a d', 'b c e f']

    """
    lyrics = lyrics.split()
    num_lines = max(pattern) + 1
    result = [list() for i in range(num_lines)]
    i = 0
    for word in lyrics:
        val = pattern[i]
        result[val].append(word)
        i += 1
        i %= len(pattern)
    if i != 0:
        logging.warning('Pattern is not fully matched, ended on %d', i)
    return [' '.join(line) for line in result]