#include using namespace std; random_device rnd; mt19937 mt(rnd()); int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); double st = clock(); int N; cin >> N; if(N == 1){cout << -1 << endl; return 0;} vector> A(N); for(int i=0; i> A.at(i).first,A.at(i).second = i; sort(A.begin(),A.end()); if(N < 10){ vector> M(1e6); vector P(N); iota(P.begin(),P.end(),1); do{ int Xor = 0; for(int i=0; i idx; for(int i=1; i<=N; i++) idx.insert(i); int swap1 = -1,swap2 = -1; vector answer(N); for(int i=0; i= 1.8) break; int pos1 = mt()%N,pos2 = pos1; while(pos2 == pos1){pos2 = mt()%N;} auto[a1,p1] = A.at(pos1); auto[a2,p2] = A.at(pos2); for(int d=0; d<20; d++) for(int d2=d+1; d2<20; d2++){ if(N > (1<