#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int bit[1000001];
vector<pair<int, int> > q[1000001];
int ans[1000001];
map<int, int> last;
int n, m;
void update(int i, int x) {
  while (i <= n) {
    bit[i] ^= x;
    i += (i & -i);
  }
}
int get(int i) {
  int res = 0;
  while (i > 0) {
    res ^= bit[i];
    i -= (i & -i);
  }
  return res;
}
int main() {
  bit[0] = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    q[r].push_back(make_pair(l, i));
  }
  for (int i = 1; i <= n; ++i) {
    if (last.find(a[i]) != last.end()) {
      update(last[a[i]], a[i]);
    }
    update(i, a[i]);
    last[a[i]] = i;
    a[i] ^= a[i - 1];
    for (auto query : q[i]) {
      ans[query.second] =
          a[i] ^ a[query.first - 1] ^ get(i) ^ get(query.first - 1);
    }
  }
  for (int i = 1; i <= m; ++i) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
