#include using namespace std; void fail(){ cout << -1 << endl; exit(0); } void answer(vector A){ int N = A.size(); for(int i=0; i> N >> P >> Q; P--; Q--; vector A(N); for(int i=0; i> A[i], A[i]--; if(!next_permutation(A.begin(), A.end())) fail(); int posP = -1, posQ = -1; for(int i=0; i()); if(!next_permutation(A.begin(), A.end())) fail(); for(int i=0; i