Originally Posted by

**Vlasev** I think you mean that the entries are $\displaystyle A,B \in GL(2,\mathbb{Z}_n)$?

You probably know this but I will say it anyway to double check. $\displaystyle GL(r,\mathbb{Z}_n)$ is the general linear group over the cyclic group $\displaystyle \mathbb{Z}_n$ (field). It has dimension $\displaystyle r^2$ and is a subset of the $\displaystyle r \times r$ matrices. It consists of the invertible matrices, so $\displaystyle A$ and $\displaystyle B$ are invertible matrices. That means that each determinant is a unit in $\displaystyle \mathbb{Z}_n$.