#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
map<long long, int> Map;
struct Q {
  int l;
  int r;
  int id;
} ask[maxn];
int n, m, a[maxn];
long long one_xor[maxn], all_xor[maxn], ans[maxn];
void init() {
  scanf("%d", &n);
  all_xor[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    all_xor[i] = all_xor[i - 1] ^ a[i];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &ask[i].l, &ask[i].r);
    ask[i].id = i;
  }
}
bool cmp(Q a, Q b) {
  if (a.r == b.r) return a.l < b.l;
  return a.r < b.r;
}
int lowbit(int x) { return x & (-x); }
void add(int pos, long long x) {
  for (int i = pos; i <= n; i += lowbit(i)) one_xor[i] ^= x;
}
long long query(int r) {
  long long ans = 0;
  for (int i = r; i >= 1; i -= lowbit(i)) ans ^= one_xor[i];
  return ans;
}
void solve() {
  int cur = 1;
  for (int i = 1; i <= n; i++) {
    if (Map.find(a[i]) != Map.end()) {
      add(Map[a[i]], a[i]);
      add(i, a[i]);
      Map[a[i]] = i;
    } else {
      add(i, a[i]);
      Map[a[i]] = i;
    }
    while (ask[cur].r == i && cur <= m) {
      int l = ask[cur].l;
      int r = ask[cur].r;
      ans[ask[cur].id] = query(l - 1) ^ query(r) ^ all_xor[r] ^ all_xor[l - 1];
      cur++;
    }
  }
  for (int i = 1; i <= m; i++) printf("%I64d\n", ans[i]);
}
int main() {
  init();
  sort(ask + 1, ask + 1 + m, cmp);
  solve();
  return 0;
}
