Solution (source code)

= Solution

A decimal integer is congruent modulo $3$ to its digit sum. Cyclic permutation does not change that sum. Hence every rotation of a multiple of $3$ is again divisible by $3$.