#!/usr/bin/env python3
"""Auto-generated by AGI Loop cycle #1224
Task: </think>

Write a Python function that takes two lists of lists (matrices) and returns their matrix product, assuming compatible dimensions.
Generated: 2026-02-13T00:48:16.838641
"""

def matrix_multiply(matrix_a, matrix_b):
    # Get dimensions
    rows_a = len(matrix_a)
    cols_a = len(matrix_a[0])
    rows_b = len(matrix_b)
    cols_b = len(matrix_b[0])

    # Result matrix initialized with zeros
    result = [[0 for _ in range(cols_b)] for _ in range(rows_a)]

    # Matrix multiplication
    for i in range(rows_a):
        for j in range(cols_b):
            for k in range(cols_a):
                result[i][j] += matrix_a[i][k] * matrix_b[k][j]

    return result


if __name__ == '__main__':
    # Example matrices
    matrix_a = [[1, 2], [3, 4]]
    matrix_b = [[5, 6], [7, 8]]

    product = matrix_multiply(matrix_a, matrix_b)
    for row in product:
        print(row)