#include <bits/stdc++.h>
using namespace std;
int arr[1000005];
int n;
vector<int> bit;
int xori(int r) {
  int ret = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) ret = ret ^ bit[r];
  return ret;
}
void update(int idx, int val) {
  for (; idx < n; idx = idx | (idx + 1)) bit[idx] = (bit[idx] ^ val);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  bit.resize(n);
  for (int i = 0; i < n; i++) {
    cin >> arr[i];
    update(i, arr[i]);
  }
  vector<pair<pair<int, int>, int>> q;
  int m;
  cin >> m;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    l--;
    r--;
    q.push_back({{r, l}, i});
  }
  sort(q.begin(), q.end());
  int pre[n + 1];
  pre[0] = 0;
  for (int i = 1; i <= n; i++) {
    pre[i] = pre[i - 1] ^ arr[i - 1];
  }
  int last[n];
  map<int, int> ma;
  last[0] = -1;
  ma[arr[0]] = 1;
  for (int i = 1; i < n; i++) {
    if (ma[arr[i]] == 0) {
      ma[arr[i]] = i + 1;
      last[i] = -1;
    } else {
      last[i] = ma[arr[i]] - 1;
      ma[arr[i]] = i + 1;
    }
  }
  int ans[m];
  int r_last = -1;
  for (int i = 0; i < m; i++) {
    int l = q[i].first.second;
    int r = q[i].first.first;
    int ind = q[i].second;
    while (r > r_last) {
      r_last++;
      int value = last[r_last];
      if (value == -1) {
        continue;
      } else {
        update(value, arr[value]);
      }
    }
    int val = xori(r) ^ xori(l - 1);
    ans[ind] = (val) ^ (pre[r + 1]) ^ (pre[l]);
  }
  for (int i = 0; i < m; i++) {
    cout << ans[i] << '\n';
  }
  return 0;
}
