Let $(x_1,\dots,x_r)$ be a non-zero element of $\mathbb{Z}^r$, and let $h$ be the highest common factor of $x_1, \dots, x_r$. Show that there is an isomorphism $\mathbb{Z}^r \to \mathbb{Z}^r$ taking $(x_1,\dots,x_r)$ to $(1, 0, 0,\dots,0)$ if and only if $h=1$.
One direction isn't too bad; if $\phi$ is such an isomorphism then $ \phi\big((x_1,\dots,x_r)\big) = (1,0,\dots,0) $ $ \phi\big(h(\tfrac{x_1}{h},\dots,\tfrac{x_r}{h})\big) = (1,0,\dots,0) $ $ h \phi\big((\tfrac{x_1}{h},\dots,\tfrac{x_r}{h})\big) = (1,0,\dots,0). $ But then $h|1$, so we must have $h=1$. I really have no idea how to go about proving the other direction... so any help would be appreciated.