#include <bits/stdc++.h>
using namespace std;
const int mx = 1e6 + 10;
int a[mx], o[mx];
vector<int> lft[mx], qs[mx];
int ans[mx];
int f[mx];
int pos[mx];
int ft[mx];
void upd(int i, int v) {
  for (++i; i < mx; i += (i & -i)) ft[i] ^= v;
}
int qry(int i) {
  int a = 0;
  for (++i; i > 0; i -= (i & -i)) a ^= ft[i];
  return a;
}
long long int rng(int l, int r) { return qry(r) ^ qry(l - 1); }
int main() {
  int n, m, l, r;
  scanf("%d", &n);
  int xr = 0;
  for (int i = 0; i < n; i++) {
    scanf("%d", a + i);
    o[i] = a[i];
    xr ^= a[i];
    f[i] = xr;
  }
  sort(o, o + n);
  int cnt = unique(o, o + n) - o;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &l, &r);
    --l, --r;
    lft[r].push_back(l);
    qs[r].push_back(i);
    ans[i] = f[r];
    if (l - 1 >= 0) ans[i] ^= f[l - 1];
  }
  memset(pos, -1, sizeof pos);
  for (int i = 0; i < n; i++) {
    int idx = lower_bound(o, o + cnt, a[i]) - o;
    if (pos[idx] != -1) {
      upd(pos[idx], a[i]);
    }
    pos[idx] = i;
    upd(i, a[i]);
    for (int j = 0; j < int(lft[i].size()); j++) {
      l = lft[i][j];
      int q = qs[i][j];
      ans[q] ^= rng(l, i);
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
