Question 78
There is written a number $N$ (in the decimal representation) on the board. In a step we erase the last digit $c$ and instead of the number $m$, which is now left on the board, we write number $|m - 3c|$ (for example, if $N = 1204$ was written on the board, then after the step there will be $120 - 3 \cdot 4 = 108$). We continue until there is a one-digit number on the board. Find all positive integers $N$ such that after a finite number of steps number $0$ is left on the board.