Find the inverse of a matrix with a variable $$X=
\begin{pmatrix}
2-n & 1 & 1 & 1 & \ldots & 1 & 1 \\
1 & 2-n & 1 & 1 & \ldots & 1 & 1 \\
\vdots & \vdots & \vdots & \vdots & \ddots & \vdots & \vdots \\
1 & 1 & 1 & 1 & \ldots & 2-n & 1 \\
1 & 1 & 1 & 1 & \ldots & 1 & 2-n\end{pmatrix}_{n\times n}
$$
Which means that the matrix with the size of $n\times n$ have $n-2$ along the diagonal and $1$ everywhere else. 
Help please, I am stuck with this problem.

Hint: Use the Sherman–Morrison formula on $$X=\text{diag}(1-n)_{n\times n}+\begin{pmatrix} 1\\ \vdots \\1\end{pmatrix}_{n\times 1}\begin{pmatrix}1 & \ldots &1 \end{pmatrix}_{1\times n}.$$
