print6174.
by caio
01. Take any four-digit number. The numbers in it can't all be the same.
02. Order the numbers, first, in ascending order (we'll call that number a). Then in descending order (we'll call that number b).
03. Subtract a from b.
04. Take the result and repeat steps 2 and 3.
05. Do that until you get 6174.