#include <bits/stdc++.h>   #pragma comment(linker,  /STACK:640000000 )   using namespace std;   const long long INF = (1e15) + 4;   const int N = 1e6 + 5;   const int K = 26;   int a[N];   int t[N];   int n;   int nxt[N];   int c[N];   int sum(int r) {     int result = 0;     for (; r >= 0; r = (r & (r + 1)) - 1) result ^= t[r];     return result;   }   void inc(int i, int d) {     for (; i < n; i = (i | (i + 1))) t[i] ^= d;   }   vector<pair<int, int>> z[N];   int answer[N];   int get_ans(int l, int r) {     int answer1 = c[r];     if (l > 0) answer1 ^= c[l - 1];     int answer2 = sum(r);     return (answer1 ^ answer2);   }   int main() {     scanf( %d , &n);     map<int, int> b;     for (int i = 0; i < n; i++) {       scanf( %d , &a[i]);       nxt[i] = -1;       c[i] = a[i];       if (i) c[i] ^= c[i - 1];     }     for (int i = n - 1; i >= 0; i--) {       if (b.count(a[i])) nxt[i] = b[a[i]];       b[a[i]] = i;     }     int m;     scanf( %d , &m);     for (int i = 0; i < m; i++) {       int l, r;       scanf( %d %d , &l, &r);       l--;       r--;       z[l].push_back(make_pair(r, i));     }     set<int> s;     for (int i = 0; i < n; i++) {       if (s.count(a[i]) == 0) inc(i, a[i]);       s.insert(a[i]);     }     for (int i = 0; i < n; i++) {       for (int j = 0; j < z[i].size(); j++) {         answer[z[i][j].second] = get_ans(i, z[i][j].first);       }       inc(i, a[i]);       if (nxt[i] != -1) inc(nxt[i], a[i]);     }     for (int i = 0; i < m; i++) {       printf( %d n , answer[i]);     }     return 0;   }   