#include <bits/stdc++.h>
using namespace std;
int tavan(int a, int n, int mod) {
  int res = 1;
  while (n) res *= (n & 1) ? a : 1, res %= mod, n /= 2, a *= a, a %= mod;
  return res;
}
const int N = ((int)1001 * 1000);
const int INF = ((int)1e9);
const int MOD = ((int)1e9 + 7);
int n, m, a[N], xr[N], seg[4 * N], ans[N];
vector<pair<int, int> > q[N];
map<int, int> last;
void update(int q, int xl, int xr, int id, int num) {
  if (xl >= xr) return;
  if (xl == xr - 1) {
    seg[id] = num;
    return;
  }
  int mid = (xl + xr) / 2;
  if (q < mid)
    update(q, xl, mid, id * 2, num);
  else
    update(q, mid, xr, id * 2 + 1, num);
  seg[id] = seg[id * 2] ^ seg[id * 2 + 1];
}
int query(int ql, int qr, int xl, int xr, int id) {
  if (qr <= xl || xr <= ql) return 0;
  if (ql <= xl && xr <= qr) {
    return seg[id];
  }
  int mid = (xl + xr) / 2;
  return query(ql, qr, xl, mid, id * 2) ^ query(ql, qr, mid, xr, id * 2 + 1);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    xr[i] = xr[i - 1] ^ a[i];
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    q[r].push_back({l, i});
  }
  for (int i = 1; i <= n; i++) {
    update(i, 0, N, 1, a[i]);
    if (last[a[i]] != 0) update(last[a[i]], 0, N, 1, 0);
    last[a[i]] = i;
    for (int j = 0; j < q[i].size(); j++) {
      ans[q[i][j].second] =
          query(q[i][j].first, i + 1, 0, N, 1) ^ xr[i] ^ xr[q[i][j].first - 1];
    }
  }
  for (int i = 0; i < m; i++) printf("%d\n", ans[i]);
  return 0;
}
