import numpy as np

# Define the matrix M
M = np.array([
    [0.5, 0.5, 0.3],
    [0.0, 0.3, 0.3],
    [0.5, 0.3, 0.4],
    [1.0, 1.0, 1.0]
])

# Solve for A such that A * M = M
# M.T because the system is effectively M^T @ A^T = M^T
A_T = np.linalg.lstsq(M.T, M.T, rcond=None)[0]

# Transpose A_T to get A as a row vector
A = A_T.T
print(A)
