#include <bits/stdc++.h>
using namespace std;
const int M = 1e9 + 7;
int pos[1000010];
long long int ans[1000010], BIT[1000010], n, m;
vector<pair<int, int> > a;
long long int xr[1000010];
vector<pair<pair<int, int>, int> > qrs;
void upd8(int idx) {
  long long int val = a[idx - 1].first;
  while (idx <= n) {
    BIT[idx] ^= val;
    idx += idx & -idx;
  }
}
long long int qry(int idx) {
  long long int xs = 0;
  while (idx > 0) {
    xs ^= BIT[idx];
    idx -= idx & -idx;
  }
  return xs;
}
void solve() {
  int i, j, l, r;
  cin >> n;
  a.resize(n);
  for (i = 0; i < n; i++) {
    cin >> a[i].first;
    a[i].second = i;
    xr[i + 1] = xr[i] ^ a[i].first;
  }
  sort(a.begin(), a.end());
  for (i = 0; i < n;) {
    pair<int, int> x = a[i];
    i++;
    pos[x.second] = -1;
    while (i < n && a[i].first == x.first) {
      pos[a[i].second] = x.second;
      x = a[i];
      i++;
    }
  }
  sort(a.begin(), a.end(),
       [](const pair<int, int> &a, const pair<int, int> &b) {
         return a.second < b.second;
       });
  cin >> m;
  qrs.resize(m);
  for (i = 0; i < m; i++) {
    cin >> qrs[i].first.first >> qrs[i].first.second;
    qrs[i].second = i;
  }
  sort(qrs.begin(), qrs.end(),
       [](const pair<pair<int, int>, int> &a,
          const pair<pair<int, int>, int> &b) {
         return a.first.second < b.first.second;
       });
  i = j = 0;
  while (i < n && j < m) {
    if (i < qrs[j].first.second) {
      upd8(i + 1);
      if (pos[i] != -1) upd8(pos[i] + 1);
      i++;
    } else {
      ans[qrs[j].second] =
          qry(qrs[j].first.second) ^ qry(qrs[j].first.first - 1);
      ans[qrs[j].second] ^=
          xr[qrs[j].first.second] ^ xr[qrs[j].first.first - 1];
      j++;
    }
  }
  while (j < m) {
    ans[qrs[j].second] = qry(qrs[j].first.second) ^ qry(qrs[j].first.first - 1);
    ans[qrs[j].second] ^= xr[qrs[j].first.second] ^ xr[qrs[j].first.first - 1];
    j++;
  }
  for (i = 0; i < m; i++) {
    cout << ans[i] << '\n';
  }
}
int main(int argc, char const *argv[]) {
  ios::sync_with_stdio(false);
  solve();
  return 0;
}
