#include <bits/stdc++.h>
using namespace std;
const int N = 1000 * 1000 + 100;
int n, a[N], x[N], l[N], r[N], nxt[N], ans[N], fen[N], Q;
vector<int> vec[N], query;
void upd(int x, int w) {
  for (; x <= n; x += x & (-x)) fen[x] ^= w;
}
int get(int x) {
  int res = 0;
  for (; x > 0; x -= x & (-x)) res ^= fen[x];
  return res;
}
int main() {
  ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> a[i], x[i] = x[i - 1] ^ a[i];
  cin >> Q;
  for (int i = 0; i < Q; i++) cin >> l[i] >> r[i], query.push_back(i);
  sort(query.begin(), query.end(), [](int x, int y) { return r[x] > r[y]; });
  unordered_map<int, int> last;
  for (int i = n; i >= 1; i--) {
    nxt[i] = n + 1;
    if (last.count(a[i])) nxt[i] = last[a[i]];
    last[a[i]] = i;
    vec[nxt[i]].push_back(i);
  }
  int R = n + 1;
  for (auto i : query) {
    while (R > r[i]) {
      for (auto x : vec[R]) upd(x, a[x]);
      R--;
    }
    ans[i] = x[r[i]] ^ x[l[i] - 1] ^ get(r[i]) ^ get(l[i] - 1);
  }
  for (int i = 0; i < Q; i++) cout << ans[i] << '\n';
  return 0;
}
