I have a 2Nx3 matrix R whos row vectors are unit vectors and the first N are orthogonal to corresponding N in the second half of R. Now I need for find a matrix A satisfying the following equations

simple data fitting problem-equation.jpg
where mi and mj are rows of matrix R for i=1 ... N and j=N+1 ... 2N
and mi and mj are pairwise orthogonal

Can anybody help me please