12. Find all prime pairs $(p, q)$ such that
$$p q \mid\left(2^{p}+2^{q}\right) \text {. }$$
12. Let $p \leqslant q$.

If $p=2$, then $q=2$ satisfies the condition. When $q>2$, $q$ is odd. From $2^{p}+2^{q}=2^{2}(1+2^{q-2})$, we know that $q \mid (2^{q-2}+1)$. Therefore,
$$2^{q-2} \equiv -1 \pmod{q}$$

By Fermat's Little Theorem, $2^{q-1} \equiv 1 \pmod{q}$, so
$$1 \equiv 2^{q-1} = 2^{q-2} \cdot 2 \equiv -2 \pmod{q}$$

Thus, $q \mid 3$. Therefore, in this case, there are two solutions: $(p, q) = (2, 2)$ and $(2, 3)$.
If $p>2$, by Fermat's Little Theorem, $2^{q-1} \equiv 1 \pmod{q}$. Combining this with the condition $q \mid (2^{p} + 2^{q})$, we have
$$2^{p} + 2^{q} \equiv 2^{p} + 2 \pmod{q}$$

Thus, $q \mid (2^{p-1} + 1)$, and hence $2^{2(p-1)} \equiv 1 \pmod{q}$, so
$$\delta_{q}(2) \mid 2(p-1)$$

But $\delta_{q}(2) \times (p-1)$. Therefore, let $p-1 = 2^{s} \cdot t$, where $t$ is odd, $s, t \in \mathbf{N}^{*}$, then $\delta_{q}(2) = 2^{s+1} \cdot k$, where $k$ is a factor of $t$. By $2^{q-1} \equiv 1 \pmod{q}$, we know
$$\delta_{q}(2)^{4} \mid (q-1)$$

This indicates that in the prime factorization of $q-1$ and $p-1$, the power of 2 in $q-1$ is higher than that in $p-1$. However, if we replace $q$ with $p$ and repeat the above discussion, we should have the power of 2 in $p-1$ higher than that in $q-1$, which is a contradiction. Therefore, when $q \geqslant p > 2$, there is no solution.

In summary, the only solutions for $(p, q)$ are $(2, 2)$, $(2, 3)$, or $(3, 2)$.