$5 \cdot 39$ can prove that for any given positive integer $n$, every complex number of the form $r + s i (r, s$ are integers) can be expressed as a polynomial in $(-n+i)$, and the coefficients of the polynomial all belong to $\{0,1,2, \cdots, n^{2}\}$.
That is, the equation
$$
r+s i=a_{m}(-n+i)^{m}+a_{m-1}(-n+i)^{m-1}+\cdots+a_{1}(-n+i)+
$$
$a_{0}$
holds, where $m$ is a uniquely determined non-negative integer, and $a_{0}, a_{1}, \cdots, a_{m}$ are a unique set of numbers chosen from $\{0,1, 2, \cdots, n^{2}\}$, and $a_{m} \neq 0$.
We call this equation the expansion of $r+s i$ with base $-n+i$, and write it briefly as
$$
r+s i=\left(a_{m} a_{m-1} \cdots a_{1} a_{0}\right)_{-n+i} .
$$

It is known that only a finite number of integers $k+0 i$ can be expanded as
$$
k=\left(a_{3} a_{2} a_{1} a_{0}\right)_{-3+i}, a_{3} \neq 0 .
$$

Try to find the sum of all such $k$.