You have a number:
XYZ
You mix it up:
ZXY
You subtract the smaller from the larger:
|ZXY-XYZ|
So you have:
|Z-X| |X-Y| |Y-Z| as your digits
You enter two, using those two and some simple math you can find the third. Nothing intense, just some simple algebra.