#include <bits/stdc++.h>
using namespace std;
void read(int a = 0) {
  freopen("in", "r", stdin);
  if (a) freopen("out", "w", stdout);
}
int seg[100 * 100009] = {}, from, to, n, a[10 * 100009], tans[10 * 100009] = {},
              l[10 * 100009], r[10 * 100009], ans[10 * 100009];
vector<vector<int> > ad;
map<int, int> cur;
void insert(int x, int v) {
  if (x == 0) return;
  for (; x < 10 * 100009; x += x & -x) seg[x] ^= v;
}
int get(int x) {
  int a = 0;
  for (; x; x -= x & -x) a ^= seg[x];
  return a;
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  from = 0, to = n + 1;
  ad = vector<vector<int> >(n + 1);
  for (int i = 1; i <= n; i++) cin >> a[i], tans[i] = tans[i - 1] ^ a[i];
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    cin >> l[i] >> r[i];
    ad[r[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    int tmp = cur[a[i]];
    if (tmp) insert(tmp, a[i]);
    cur[a[i]] = i;
    insert(i, a[i]);
    for (int j = 0; j < ad[i].size(); j++) {
      ans[ad[i][j]] =
          tans[i] ^ tans[l[ad[i][j]] - 1] ^ get(i) ^ get(l[ad[i][j]] - 1);
    }
  }
  for (int i = 0; i < m; i++) cout << ans[i] << "\n";
}
