Demonstration:
Question:
The following example has a general pattern
Input 1456     Output 4165
Input 2367     Output 3276
Input 8732     Output 7823

Find the general pattern in the above examples and use it to solve
Input 9023     Output 0923

Follow the above demonstration to extrapolate and solve the below question with a different pattern
The following example has a general pattern
Input 8723      Output 3278
Input 9687      Output 7869
Input 8762      Output 2678

Find the general pattern in the above examples and use it to solve
Input 9876      Output ?
