What is the smallest integer $a_0$ such that, for every positive integer $n$, there exists a sequence of positive integers $a_0, a_1, ..., a_{n-1}, a_n$ such that the first $n-1$ are all distinct, $a_0 = a_n$, and for $0 \le i \le n -1$, $a_i^{a_{i+1}}$ ends in the digits $\overline{0a_i}$ when expressed without leading zeros in base $10$.

Let's think step by step and output the final answer within \boxed{}.
user