Legendre symbol
For a large prime number, "enumerating all squares" is impossible. Instead, the Legendre symbol is used. It takes three values: 1 — a is a quadratic residue, -1 — it is not a residue, 0 — a is divisible by p.
Euler's criterion calculates the symbol with a single exponentiation: (a|p) ≡ a^((p-1)/2) (mod p). The result is 1 or p-1 (i.e. -1).
If p ≡ 3 (mod 4), finding the square root is also easy: x = a^((p+1)/4) mod p. And the second root is p - x. The given p satisfies exactly this condition.
The attached parametrlar.txt file contains p and three candidates. Only one is a quadratic residue. Find its larger square root, take the last 16 digits of its decimal representation, and assemble the flag: BAYROQ{M4TH_legendre_<16 ta raqam>}