#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 5;
int sum[MAXN];
int tt[4 * MAXN];
map<int, int> pos;
vector<pair<int, int> > query[MAXN];
int a[MAXN];
int ans[MAXN];
void update(int v, int tl, int tr, int pos, int val) {
  if (tl == tr) {
    tt[v] = val;
    return;
  }
  int tm = (tl + tr) >> 1;
  if (pos <= tm) {
    update(2 * v + 1, tl, tm, pos, val);
  } else {
    update(2 * v + 2, tm + 1, tr, pos, val);
  }
  tt[v] = tt[2 * v + 1] ^ tt[2 * v + 2];
}
int calc(int v, int tl, int tr, int l, int r) {
  if (l > r) return 0;
  if (tl == l && tr == r) {
    return tt[v];
  }
  int tm = (tl + tr) >> 1;
  return calc(2 * v + 1, tl, tm, l, min(r, tm)) ^
         calc(2 * v + 2, tm + 1, tr, max(l, tm + 1), r);
}
void solve() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a[i]);
    sum[i] = i ? sum[i - 1] ^ a[i] : a[i];
  }
  int m;
  cin >> m;
  int l, r;
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &l, &r);
    l--;
    r--;
    query[r].push_back(make_pair(l, i));
  }
  int cnt = 1;
  while (cnt <= n) cnt <<= 1;
  for (int i = 0; i < n; i++) {
    if (pos.find(a[i]) != pos.end()) {
      int cur = pos[a[i]];
      update(0, cnt - 1, 2 * cnt - 2, cnt - 1 + cur, 0);
    }
    pos[a[i]] = i;
    update(0, cnt - 1, 2 * cnt - 2, cnt - 1 + i, a[i]);
    for (int j = 0; j < (int)query[i].size(); j++) {
      int l = query[i][j].first;
      int id = query[i][j].second;
      int cur = calc(0, cnt - 1, 2 * cnt - 2, cnt - 1 + l, cnt - 1 + i);
      ans[id] = cur ^ (sum[i] ^ (l ? sum[l - 1] : 0));
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d\n", ans[i]);
  }
}
int main() {
  int t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
