Suppose $A$ is a $2\times2$ matrix with minimal polynomial $x^2- 5x+4$, $B$ is a $2\times2$ matrix with minimal polynomial $x^2 -6x +8$, and let $O$ be the $2\times2$ matrix with all entries $0$.
Find the invariant factors of the matrix $\begin{pmatrix}A & O \\ O & B \end{pmatrix}$.
I thought the characteristic polynomial is $(x-1)(x-2)(x-4)^2$, then I get stuck...