Find the smallest number $n$ such that almost all natural numbers can be represented as the sum $$a_1^{a_{p(1)}}+a_2^{a_{p(2)}}+\dots+a_n^{a_{p(n)}}$$where $a_1,\dots,a_n$ are pairwise distinct natural numbers and $p$ is a permutation of the set $\{1,\dots,n\}$.

The problem was posed on 24.03.2019 by Jacek Jurewicz on page 95 of Volume 2 of the Lviv Scottish Book.

**The prize:** A personal congratulation :)