Problem
Let $\mathbb{v}$ and $\mathbb{w}$ be $\mathbb{Z}$-valued vectors with $n$ entries, and $X$ an $n\times n$ integer-valued matrix such that $$X\mathbb{v}=\mathbb{w},\hspace{10pt}X^T \mathbb{w}=\mathbb{v},$$ so that $$X^T X \mathbb{v}=\mathbb{v},\hspace{10pt} XX^T\mathbb{w}=\mathbb{w}.$$
I would like to prove $\mathbb{v}$ and $\mathbb{w}$ have the same entries up to permutation and signs, or find a counter-example.
Some ideas
If $XX^T=1$, I could prove that each line of $X\in O(n,\mathbb{Z})$ is composed of zeros and one $\pm 1$, since it is an integer vector with norm 1. This would imply what I want, but the assumption is too strong.
All I have is that $\mathbb{v}$ is an eigenvector of $X^T X$ with eigenvalue 1. I want to say something along the lines of the transformation $X$ being orthogonal in the subspace spanned by $\mathbb{v}$, but does that make sense? And does it imply anything for $\mathbb{w}$?