#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:64000000")
using namespace std;
const int inf = (int)1e9;
const int mod = inf + 7;
const double eps = 1e-9;
const double pi = acos(-1.0);
int n, q, a[1001000];
vector<pair<int, int> > g[1001000];
int t[4 * 1001000];
int pr[1001000];
int ans[1001000];
void update(int v, int tl, int tr, int pos, int x) {
  if (tl == tr) {
    t[v] = x;
  } else {
    int mid = (tl + tr) >> 1;
    if (pos <= mid)
      update(2 * v, tl, mid, pos, x);
    else
      update(2 * v + 1, mid + 1, tr, pos, x);
    t[v] = t[2 * v] ^ t[2 * v + 1];
  }
}
int get(int v, int tl, int tr, int l, int r) {
  if (tr < l || r < tl) return 0;
  if (l <= tl && tr <= r) return t[v];
  int mid = (tl + tr) >> 1;
  int ans1 = get(2 * v, tl, mid, l, r);
  int ans2 = get(2 * v + 1, mid + 1, tr, l, r);
  return ans1 ^ ans2;
}
int main() {
  scanf("%d", &n);
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    pr[i] = a[i];
    if (i) pr[i] ^= pr[i - 1];
  }
  scanf("%d", &q);
  for (int i = 0; i < q; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    l--;
    r--;
    g[r].push_back(make_pair(l, i));
  }
  map<int, int> pos;
  for (int i = 0; i < n; i++) {
    if (pos.count(a[i])) {
      update(1, 0, n - 1, pos[a[i]], 0);
    }
    pos[a[i]] = i;
    update(1, 0, n - 1, i, a[i]);
    for (__typeof(g[i].begin()) it = g[i].begin(); it != g[i].end(); it++) {
      int r = i, l = it->first, ii = it->second;
      ans[ii] = get(1, 0, n - 1, l, r) ^ pr[r];
      if (l) ans[ii] ^= pr[l - 1];
    }
  }
  for (int i = 0; i < q; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
