#include <bits/stdc++.h>
using namespace std;
int ar[1000009], R[1000009], L[1000009], I[1000009], ANS[1000009], VAL[1000009],
    TOT[1000009], tree[10000009], XORR[1000009];
int nextI[1000009], II[1000009];
map<int, int> mymap;
vector<int> vec;
vector<pair<int, int> > QU[1000009];
pair<pair<int, int>, int> Q[1000009];
int query(int node, int beg, int end, int i, int j) {
  if (i > end || j < beg) return 0;
  if (beg >= i && end <= j) return tree[node];
  int Left = node * 2;
  int Right = node * 2 + 1;
  int mid = (beg + end) / 2;
  int p1 = query(Left, beg, mid, i, j);
  int p2 = query(Right, mid + 1, end, i, j);
  return (p1 ^ p2);
}
void update(int node, int beg, int end, int i, int newvalue) {
  if (i > end || i < beg) return;
  if (beg >= i && end <= i) {
    tree[node] = newvalue;
    return;
  }
  int Left = node * 2;
  int Right = node * 2 + 1;
  int mid = (beg + end) / 2;
  update(Left, beg, mid, i, newvalue);
  update(Right, mid + 1, end, i, newvalue);
  tree[node] = (tree[Left] ^ tree[Right]);
}
int main() {
  int i, j, k, l, n, m, ans, tot, sum, temp, index = 0, siz;
  cin >> n;
  for (i = 1; i <= n; i++) {
    scanf("%d", &ar[i]);
    vec.push_back(ar[i]);
    XORR[i] = (XORR[i - 1] ^ ar[i]);
  }
  sort(vec.begin(), vec.end());
  for (i = 0; i < n; i++) {
    if (i)
      if (vec[i] == vec[i - 1]) continue;
    mymap[vec[i]] = ++index;
    VAL[index] = vec[i];
  }
  for (i = 1; i <= n; i++) ar[i] = mymap[ar[i]];
  cin >> m;
  for (i = 1; i <= m; i++) {
    scanf("%d%d", &j, &k);
    Q[i] = make_pair(make_pair(j, k), i);
    QU[j].push_back(make_pair(k, i));
  }
  for (i = 1; i <= n; i++) sort(QU[i].begin(), QU[i].end());
  sort(Q + 1, Q + 1 + m);
  for (i = 1; i <= m; i++) {
    L[i] = Q[i].first.first;
    R[i] = Q[i].first.second;
    I[i] = Q[i].second;
  }
  for (i = 1; i <= n; i++) {
    nextI[ar[i]] = n + 1;
    II[ar[i]] = -1;
  }
  for (i = 1; i <= n; i++) {
    if (II[ar[i]] != -1) {
      nextI[II[ar[i]]] = i;
    } else
      update(1, 1, n, i, VAL[ar[i]]);
    II[ar[i]] = i;
  }
  for (i = 1; i <= n; i++) {
    siz = QU[i].size();
    for (j = 0; j < siz; j++) {
      ANS[QU[i][j].second] = ((XORR[QU[i][j].first] ^ XORR[i - 1]) ^
                              query(1, 1, n, i, QU[i][j].first));
    }
    update(1, 1, n, i, 0);
    if (nextI[i] <= n) update(1, 1, n, nextI[i], VAL[ar[i]]);
  }
  for (i = 1; i <= m; i++) printf("%d\n", ANS[i]);
}
