Suppose we have a matrix $A\in M_{m\times n}$, with all integer entries. It is known that there we can diagonalize $A$ using row and column operations so that entries on the diagonal $(d_1,d_2,\ldots,d_k)$ are s. t. $d_1 \mid d_2\mid\cdots \mid d_k$ $(d_i\gt 0)$. Problem asks to prove that $d_1d_2\cdots d_r$ is the greatest common divisor of all determinants of $r\times r$ minors of $A$.
I proved this fact for $r = 1$, since column/row operations don't change $\gcd(\text{elements of }A)$. Now I'm stuck on the case $r\gt1$? How to solve it?