In any moment of decision, the best thing you can do is the right thing, the next best thing is the wrong thing, and the worst thing you can do is nothing.
It doesn't answer your riddle but its a nice quote
[LEFT]
[/LEFT]
1 number (any number between 1 and 9) costs $10
2 numbers (any number between 10 and 99) costs $20
3 numbers (any number between 100 and 999) costs $30
4 numbers (any number between 1000 and 9999) costs $40
So he can sell 9999 and he will still be profitable