from typing import Iterable


def lines_to_matrix(lines: Iterable) -> list:
    """Build the matrix from the sequencer output lines."""
    matrix = []
    for line in lines:
        l_fields = line.split()
        if len(l_fields) == 18:
            matrix.append(l_fields)
    return matrix