**TL;DR**Source```pythonfrom Crypto.Util.number import bytes_to_long, isPrimefrom secrets import randbelow
p = bytes_to_long(open("flag.txt", "rb").read())assert isPrime(p)
a = randbelow(p)b = randbelow(p)
def f(s):    return (a * s + b) % p
print("a = ", a)print("b = ", b)print("f(31337) = ", f(31337))print("f(f(31337)) = ", f(f(31337)))```Rewrite both congruences to solve for p\*n and take the gcd, full solve script at original link