#pragma GCC target("avx2") #pragma GCC optimize("O3") #pragma GCC optimize("unroll-loops") #include using namespace std; typedef long long ll; int main(){ ll p; cin >> p; ll k = (p-1) / 2; ll targ = (p - (k * k % p + 4 * k + 2) % p) % p; for (ll i=0; i