Calculate the difference between the ``maximum integer value'' and the ``minimum integer value'' that can be obtained by rearranging the numbers of each digit for a positive integer value of 4 digits or less to create the next integer value. For a positive integer value of 4 digits or less, if you repeat the operation to create the next integer value by calculating the difference between the "maximum integer value" and the "minimum integer value" that can be obtained by rearranging the numbers of each digit , always converges to some integer value. Enter a positive integer value n of 4 or fewer digits in the command line input. Create a program that repeats the above calculation and outputs the integer values until convergence to the standard output.

`import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String n = sc.next(); String result = ""; while (!result.equals(n)) { String min = "", max = ""; for (char c : n.toCharArray()) { min += "0"; max += "9"; } result = String.valueOf(Integer.parseInt(max) - Integer.parseInt(min)); System.out.println(result); n = result; } } }`