#include #define rep(i,n) for(int i=0;i<(int)n;i++) #define all(c) (c).begin(),(c).end() #define pb push_back #define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0); using namespace std; namespace std{templatestruct hash>{size_t operator()(const pair&p)const{return ((size_t)1e9+7)*hash()(p.first)+hash()(p.second);}};templatestruct hash>{size_t operator()(const vector &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash()(i)+1;return h;}};} templateostream& operator<<(ostream &os, const vector &v){os<<"[ ";rep(i,v.size())os<ostream& operator<<(ostream &os,const set &v){os<<"{ "; for(const auto &i:v)os<ostream& operator<<(ostream &os,const map &v){os<<"{";for(const auto &i:v)os<<" "<ostream& operator<<(ostream &os,const pair &p){return os<<"("<void dbgprint(const string &fmt,const H &h,const T&... r){cerr< vi;typedef pair pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9; const int N = 200000; bitset sum; bitset b; int n, a[N]; vi pos[N]; int main(){ scanf("%d", &n); rep(i, n){ scanf("%d", a + i); pos[a[i]].pb(i); } rep(i, n){ int x; scanf("%d", &x); b[i] = x; } rep(i, N) if(pos[i].size()){ bitset tmp; for(int j : pos[i]) tmp |= b << j; sum ^= tmp; //rep(j, 20)cerr<