5. Find all natural numbers $a$ and $b$ and prime numbers $p$ and $q$ such that at least one of the numbers $p$ and $q$ is greater than 12 and the following holds:

$$
p^{a}+q^{b}=19^{a}
$$
5. Since $p^{a}+q^{b}$ is an odd number, at least one of the numbers $p$ and $q$ is even, and it must be equal to 2.
(i) Let $q=2$. Then $19-b \mid 19^{a}-p^{a}=2^{b}$, so $19-p$ is a power of two, i.e., $p \in\{3,11,17\}$. According to the problem, only $p=17$ is possible.

If $2 \mid a$, then $19^{2}-17^{2}=72$ divides $19^{a}-17^{a}=2^{b}$, which is impossible. On the other hand, if $2 \nmid a$, then $2^{b-1}=\frac{19^{a}-17^{a}}{19-17}=\sum_{i=0}^{a-1} 19^{a-1-i} 17^{i}$ is odd, which is possible only for $b=a=1$. Therefore, in this case, the only solution is $(p, q, a, b)=(17,2,1,1)$.

(ii) Let $p=2$. Then $q^{b}=19^{a}-2^{a}=17 C$, where $C=\sum_{i=0}^{a-1} 19^{i} 2^{a-1-i}$. From this, it follows that $q=17$ and $C=17^{k}$ for some $k \in \mathbb{N}_{0}$.

For $a=1$, we get the solution $(p, q, a, b)=(2,17,1,1)$. Let $a>1$. Then $17 \mid C$. On the other hand, since $19^{i} \equiv 2^{i}(\bmod 17)$, we have $C \equiv$ $\sum_{i=0}^{a-1} 2^{i} 2^{a-1-i}=a \cdot 2^{a-1}(\bmod 17)$, from which it follows that $17 \mid a$. Therefore, $19^{a}-2^{a}$ is divisible by $D=19^{17}-2^{17}$. However, $D=(2+17)^{17}-2^{17}=$ $\sum_{i=0}^{17}\binom{17}{i} 2^{17-i} 17^{i}-2^{17}=\sum_{i=1}^{17}\binom{17}{i} 2^{17-i} 17^{i} \equiv\binom{17}{1} 2^{16} \cdot 17\left(\bmod 17^{3}\right)$, as all other terms are divisible by $17^{3}$. Therefore, $D$ is not divisible by $17^{3}$, but $D>17^{2}$, so $D$ cannot be a power of 17. It follows that there are no solutions for $a>1$.

Therefore, the only solutions $(p, q, a, b)$ are $(2,17,1,1)$ and $(17,2,1,1)$.