#include <bits/stdc++.h>
using namespace std;
struct XORBIT {
  int n;
  vector<int> t;
  XORBIT() {}
  XORBIT(int _n) : n(_n + 1), t(_n + 1) {}
  void update(int k, int val) {
    k++;
    while (k < n) {
      t[k] ^= val;
      k += (k & -k);
    }
  }
  int sum(int k) {
    int r = 0;
    while (k > 0) {
      r ^= t[k];
      k -= (k & -k);
    }
    return r;
  }
  int sum(int l, int r) { return sum(r) ^ sum(l); }
};
const int NM_MAX = 1000001;
int N, M;
vector<int> A, sum;
int main() {
  cin >> N;
  A.resize(N);
  for (int(i) = (0); (i) < (int)(N); ++(i)) scanf("%d", &A[i]);
  cin >> M;
  vector<vector<pair<int, int>>> qu(N);
  for (int(i) = (0); (i) < (int)(M); ++(i)) {
    int L, R;
    scanf("%d%d", &L, &R);
    qu[--R].emplace_back(--L, i);
  }
  sum.resize(N + 1);
  for (int(i) = (0); (i) < (int)(N); ++(i)) sum[i + 1] = sum[i] ^ A[i];
  auto bit = XORBIT(N);
  unordered_map<int, int> last;
  vector<int> ans(M);
  for (int(i) = (0); (i) < (int)(N); ++(i)) {
    if (last.count(A[i])) {
      bit.update(last[A[i]], A[i]);
    }
    last[A[i]] = i;
    bit.update(i, A[i]);
    for (auto q : qu[i]) {
      int l = q.first, r = i + 1, k = q.second;
      ans[k] = sum[r] ^ sum[l] ^ bit.sum(l, r);
    }
  }
  for (int(i) = (0); (i) < (int)(M); ++(i)) printf("%d\n", ans[i]);
}
