find cokernel of a matrix 
Let  $$T=\begin{pmatrix} 1&2&3 \\ 5&4&2\\1&2&3\\2&1&4
\end{pmatrix}.$$ Find the cokernel of $T$.

I have tried to find Smith Normal Form of this matrix $S=\begin{pmatrix} 1&0&0 \\
0&1&0\\0&0&27\\0&0&0\end{pmatrix}$
so the cokernel should be $\mathbb Z/1\oplus\mathbb Z/1\oplus\mathbb Z/27\oplus\mathbb Z$ but we can wrote it as  $\mathbb Z/27\oplus\mathbb Z$  is it right?

All of your work is correct, well done.
Regarding the Smith normal form: we have $UTV = S$, with the $S$ that you wrote and
$$
U = \left(
\begin{array}{cccc}
 1 & 0 & 0 & 0 \\
 2 & 0 & 0 & -1 \\
 -35 & -1 & 0 & 20 \\
 -1 & 0 & 1 & 0 \\
\end{array}
\right), \quad 
V = \left(
\begin{array}{ccc}
 1 & -4 & -5 \\
 0 & -1 & -2 \\
 0 & 2 & 3 \\
\end{array}
\right).
$$
