#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:167772160000")
using namespace std;
int a[1100000];
int sum[1100000];
set<int> have;
bool cmp_1(pair<std::pair<int, int>, int> a, pair<std::pair<int, int>, int> b) {
  return a.first.second < b.first.second;
}
pair<std::pair<int, int>, int> queries[1100000];
int fen[1100000];
int n;
void upd(int a, int b) {
  if (a > n) return;
  fen[a] ^= b;
  upd(a + (a & (-a)), b);
}
int get(int a) {
  if (a == 0) return 0;
  return fen[a] ^ get(a - (a & (-a)));
}
int find(int a, int b) { return get(b) ^ get(a - 1); }
int find2(int a, int b) { return sum[b] ^ sum[a - 1]; }
map<int, int> lastPlace;
int answer[1100000];
int main() {
  scanf("%d", &n);
  ;
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  ;
  int m;
  scanf("%d", &m);
  ;
  for (int i = 0; i < m; i++) {
    scanf("%d", &queries[i].first.first);
    ;
    scanf("%d", &queries[i].first.second);
    ;
    queries[i].second = i;
  }
  sum[0] = 0;
  for (int i = 1; i <= n; i++) sum[i] = sum[i - 1] ^ a[i];
  for (int i = 1; i <= n; i++) fen[i] = 0;
  sort(queries, queries + m, cmp_1);
  int j = 0;
  for (int i = 1; i <= n; i++) {
    map<int, int>::iterator it = lastPlace.find(a[i]);
    if (it == lastPlace.end()) {
      upd(i, a[i]);
      lastPlace[a[i]] = i;
    } else {
      upd(it->second, it->first);
      it->second = i;
      upd(it->second, it->first);
    }
    while (j < m && queries[j].first.second == i) {
      answer[queries[j].second] =
          find(queries[j].first.first, queries[j].first.second) ^
          find2(queries[j].first.first, queries[j].first.second);
      j++;
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d\n", answer[i]);
  }
  return 0;
}
