You can extract all digits by repeating the process: take for the last digit, then set .
For : extract , becomes . Extract , becomes . Extract , becomes . Extract , becomes . Extract , becomes . Stop.
This pattern (modulo to extract, division to remove) appears in digit manipulation problems constantly.