sort input digits or strings