#include using namespace std; using ll=long long; using pll=pair; using tll=tuple; using ld=long double; const ll INF=(1ll<<60); #define rep(i,n) for (ll i=0;i<(ll)(n);i++) #define all(v) v.begin(),v.end() template inline bool chmin(T &a,T b){ if(a>b){ a=b; return true; } return false; } template inline bool chmax(T &a,T b){ if(a> n; vector a(n); rep(i,n) cin >> a[i]; if(n<=2){ if(((a[0]+1)^(a[1]+2))==((a[0]+2)^(a[1]+1))){ cout << "1 2\n"; cout << "2 1\n"; }else{ cout << "-1\n"; } return 0; } vector o,e; rep(i,n){ if(a[i]&1) o.push_back(i); else e.push_back(i); } vector p(n),q(n); if(2<=(ll)o.size()){ ll now=3; rep(i,n){ if(i==o[0]){ p[i]=1; }else if(i==o[1]){ p[i]=2; }else{ p[i]=now; now++; } } q=p; swap(q[o[0]],q[o[1]]); }else{ ll now=1; rep(i,n){ if(i==e[0]){ p[i]=2; }else if(i==e[1]){ p[i]=3; }else{ p[i]=now; if(now==1) now=4; else now++; } } q=p; swap(q[e[0]],q[e[1]]); } rep(i,n) cout << p[i] << ' '; cout << '\n'; rep(i,n) cout << q[i] << ' '; cout << '\n'; }