3. Let $n \in \mathbf{Z}_{+}$. For positive integers $a, b, c$, we have $a+$ $b+c=5 n$. Find the maximum value of $(a, b)+(b, c)+(c, a)$.
3. Let $G=(a, b)+(b, c)+(c, a)$.

Assume $a \leqslant b \leqslant c$. Then $(a, b) \leqslant a, (b, c) \leqslant b, (c, a) \leqslant a$.
Thus, $G \leqslant a+b+a \leqslant a+b+c \leqslant 5 n$.
If $3 \mid n$, when $a=b=c=\frac{5}{3} n$, $G_{\text {max }}=5 n$.
If $3 \nmid n$, then $a, b, c$ cannot all be equal. We discuss the cases as follows.
(1) $b=c$, and $b \leqslant 2 n$.
Since $a \neq b$, we have
$$
(a, b)=(a, b-a) \leqslant b-a \text {. }
$$

Then $G \leqslant(b-a)+b+a=2 b \leqslant 4 n$.
(2) $b=c$, and $b>2 n$.

Then $a+2 b=5 n \Rightarrow a=5 n-2 b$
$$
\begin{array}{r}
\Rightarrow G \leqslant a+b+a=10 n-4 b+b \\
=10 n-3 b<10 n-6 n=4 n .
\end{array}
$$
(3) $b \neq c$ and $c-a \geqslant n$.

Then $G \leqslant a+b+a=(a+b+c)-(c-a)$ $=5 n-(c-a) \leqslant 5 n-n=4 n$.
(4) $b \neq c$ and $c-a<n$.

Since $a \leqslant b \leqslant c$, we have $c-b<n$.
By $b \neq c$, we know
$$
\begin{array}{l}
(c, a)=(c-a, a) \leqslant c-a<n, \\
(b, c)=(b, c-b) \leqslant c-b<n .
\end{array}
$$

Also, $a \leqslant \frac{5}{3} n$, thus, $G \leqslant \frac{5}{3} n+n+n<4 n$.
Combining (1) to (4), we know $G \leqslant 4 n$.
When $a=n, b=c=2 n$,
$$
(a, b)=(c, a)=n,(b, c)=2 n \text {. }
$$

At this point, $G=4 n$.
Therefore, $G_{\max }=\left\{\begin{array}{ll}5 n, & 3 \mid n ; \\ 4 n, & 3 \nmid n .\end{array}\right.$