We call a number $10^3 < n < 10^6$ a balanced number if the sum of its last three digits is equal to the sum of its other digits. Find the sum of all balanced numbers in $\bmod{13}$.

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