#include <bits/stdc++.h>
using namespace std;
int N, m;
int A[1000005], ans[1000005];
int pref_xor[1000005];
unordered_map<int, int> last;
vector<pair<int, int> > queries[1000005];
int BIT[1000005];
void update(int x, int v) {
  for (; x <= N; x += (x & (-x))) BIT[x] ^= v;
}
int query(int x) {
  int sum = 0;
  while (x >= 1) {
    sum ^= BIT[x];
    x -= (x & (-x));
  }
  return sum;
}
int main() {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &A[i]);
    pref_xor[i] = pref_xor[i - 1] ^ A[i];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    queries[r].push_back(pair<int, int>(l, i));
  }
  for (int r = 1; r <= N; r++) {
    if (last.find(A[r]) != last.end()) update(last[A[r]], A[r]);
    last[A[r]] = r;
    update(r, A[r]);
    for (int i = 0; i < queries[r].size(); i++) {
      int q = queries[r][i].second;
      int l = queries[r][i].first;
      ans[q] = (pref_xor[r] ^ pref_xor[l - 1]) ^ (query(r) ^ query(l - 1));
    }
  }
  for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
  return 0;
}
