#include <bits/stdc++.h>
using namespace std;
int pre[1000025], a[1000025], ans[1000025], bit[1000025];
std::vector<pair<int, int> > v[1000025];
map<int, int> mp;
int n;
void update(int k, int val) {
  while (k <= n) {
    bit[k] ^= val;
    k += k & -k;
  }
}
int query(int k) {
  int res = 0;
  while (k) {
    res ^= bit[k];
    k -= k & -k;
  }
  return res;
}
int main() {
  int i, k, x, y;
  scanf("%d", &n);
  for (i = 1; i <= n; i++) {
    scanf("%d", a + i);
    pre[i] = pre[i - 1] ^ a[i];
  }
  scanf("%d", &k);
  for (i = 0; i < k; i++) {
    scanf("%d %d", &x, &y);
    v[y].emplace_back(make_pair(x, i));
  }
  for (i = 1; i <= n; i++) {
    if (mp.find(a[i]) != mp.end()) update(mp[a[i]], a[i]);
    update(i, a[i]);
    mp[a[i]] = i;
    for (int j = 0; j < v[i].size(); j++)
      ans[v[i][j].second] = pre[i] ^ pre[v[i][j].first - 1] ^
                            (query(i) ^ query(v[i][j].first - 1));
  }
  for (i = 0; i < k; i++) printf("%d\n", ans[i]);
}
