Sort by the last digit, then the one before it, and so on: one stable pass per digit, with a bucket for each digit value.
This interactive visualization needs JavaScript.