Package invert %% Read two integers x and m, and print the inverse %% of x mod m. Import "math/modular". Import "collect/string". Execute Writeln["I will compute the inverse of x (mod y)."]. Writeln["Please type x and y, separated by a space."]. Try Extract[$(?x: Integer), $(?y: Natural)] from bxStdin. {y > 0} then Let inv = remainder(/(x _modulo_ y)). Writeln[$x, " inverse mod ", $y, " = ", $inv]. else Writeln["The input is not correct."]. %Try %Execute %Package