#include #include using namespace std; #include using namespace atcoder; using ll = long long; int N; vector A; void solve(){ set st; for(int i = 0;i a(N),b(N); vector bin[2]; for(int i = 0;i 1){ int l = bin[0][0]; int r = bin[0][1]; a[l] = 2; a[r] = 3; b[r] = 2; b[l] = 3; st.erase(1); st.erase(3); }else if(bin[1].size() >1){ int l = bin[1][0]; int r = bin[1][1]; a[l] = 1; a[r] = 2; b[r] = 1; b[l] = 2; st.erase(1); st.erase(2); }else{ cout<<-1<> N; A = vector(N); for (int i = 0; i < N; i++) { cin >> A[i]; } solve(); }