From AM = P we get \(A^{-1}P = M\). Test the options: for a candidate X, the columns of XP are \(X\cdot(\text{column } j \text{ of } P)\).
The columns of P are (0,1,0), (0,0,1), (1,0,0), so XP has columns (column 2 of X), (column 3 of X), (column 1 of X).
For option (1), \(X = \begin{bmatrix}3&1&2\\3&0&2\\1&0&1\end{bmatrix}\): the columns of XP are (1,0,0), (2,2,1), (3,3,1), i.e. \(XP = \begin{bmatrix}1&2&3\\0&2&3\\0&1&1\end{bmatrix} = M\), as required.
For option (2) the first column of XP would be (2,2,1), not (1,0,0), and options (3) and (4) fail similarly.
Answer: (1) \(\begin{bmatrix}3&1&2\\3&0&2\\1&0&1\end{bmatrix}\)