#include <bits/stdc++.h>
using namespace std;
mt19937 rnd(1337);
ostream& operator<<(ostream& a, const pair<long long, long long>& b) {
  cout << "{" << b.first << ", " << b.second << "}";
  return a;
}
ostream& operator<<(ostream& a, const vector<long long int>& b) {
  for (auto& k : b) cout << k << " ";
  return a;
}
ostream& operator<<(ostream& a, const vector<pair<long long, long long>>& b) {
  for (auto& k : b) cout << k << " ";
  return a;
}
const long long int INF = (long long int)1e18;
const long long int MOD = 1000 * 1000 * 1000 + 7, MOD2 = 274876858367;
const long long int maxn = (long long int)1e6 + 10, L = 10;
#pragma GCC optimize( \
    "Ofast,vpt,unroll-loops,shrink-wrap-separate,loop-nest-optimize")
unordered_map<long long int, long long int> last;
long long int cnt[maxn], tree[maxn], n;
long long int calc(long long int r) {
  long long int res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) {
    res ^= tree[r];
  }
  return res;
}
void upd(long long int pos, long long int val) {
  for (; pos < n; pos = (pos | (pos + 1))) tree[pos] ^= val;
}
long long int get(long long int l, long long int r) {
  return (calc(r) ^ calc(l - 1));
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  vector<long long int> a(n), dp(n);
  for (long long int i = 0; i < n; ++i) {
    cin >> a[i];
    last[a[i]] = -1;
    dp[i] = (i ? dp[i - 1] : 0ll) ^ a[i];
  }
  long long int q;
  cin >> q;
  vector<long long int> ans(q);
  vector<pair<pair<long long, long long>, long long int>> quer;
  for (long long int i = 0; i < q; ++i) {
    long long int l, r;
    cin >> l >> r;
    quer.push_back({{l, r}, i});
  }
  sort(quer.begin(), quer.end(),
       [&](pair<pair<long long, long long>, long long int>& a,
           pair<pair<long long, long long>, long long int>& b) {
         return a.first.second < b.first.second ||
                (a.first.second == b.first.second &&
                 a.first.first < b.first.first);
       });
  long long int inx = 0;
  for (long long int i = 0; i < n; ++i) {
    long long int was = last[a[i]];
    if (was != -1) upd(was, a[i]);
    upd(i, a[i]);
    last[a[i]] = i;
    while (inx < q && quer[inx].first.second == i + 1) {
      ;
      long long int led = quer[inx].first.first - 1,
                    red = quer[inx].first.second - 1;
      ans[quer[inx].second] =
          (get(led, red) ^ dp[red] ^ (led ? dp[led - 1] : 0ll));
      ++inx;
    }
  }
  for (long long int x : ans) cout << x << '\n';
  return 0;
}
