import java.util.*;
import java.lang.*;
import java.math.BigInteger;
class Main
{
{
System.
out.
println(x.
modInverse(p
)); }
}
aW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLm1hdGguQmlnSW50ZWdlcjsKCmNsYXNzIE1haW4KewoJcHVibGljIHN0YXRpYyB2b2lkIG1haW4gKFN0cmluZ1tdIGFyZ3MpIHRocm93cyBqYXZhLmxhbmcuRXhjZXB0aW9uCgl7CiAgICAgICAgQmlnSW50ZWdlciB4PW5ldyBCaWdJbnRlZ2VyKCIxIik7CiAgICAgICAgQmlnSW50ZWdlciBwPW5ldyBCaWdJbnRlZ2VyKCI0Mjk0OTY3Mjk2Iik7CglTeXN0ZW0ub3V0LnByaW50bG4oeC5tb2RJbnZlcnNlKHApKTsJCgl9Cn0=