#include <bits/stdc++.h>
using namespace std;
int MOD = 1e9 + 7;
int INF = 0x3f3f3f3f;
int n, q, a[1000005], ps[1000005];
int ans[1000005];
vector<pair<int, int> > qu[1000005];
namespace BIT {
int bit[1000005] = {};
void update(int idx, int v) {
  for (; idx <= n; idx += idx & -idx) bit[idx] ^= v;
}
int query(int idx) {
  int rt = 0;
  for (; idx > 0; idx -= idx & -idx) rt ^= bit[idx];
  return rt;
}
int query(int l, int r) { return query(l - 1) ^ query(r); }
}  // namespace BIT
int cnt[1000005];
unordered_map<int, int> lst;
int getsum(int l, int r) { return ps[r] ^ ps[l - 1]; }
int solve() {
  cin >> n;
  for (int i = 0; i < n; i++) cin >> a[i];
  ps[0] = 0;
  for (int i = 0; i < n; i++) ps[i + 1] = ps[i] ^ a[i];
  cin >> q;
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    qu[r].push_back({l, i});
  }
  for (int r = 0; r < n; r++) {
    if (lst.count(a[r]))
      BIT::update(lst[a[r]] + 1, cnt[lst[a[r]]]), cnt[lst[a[r]]] = 0;
    lst[a[r]] = r;
    cnt[r] = a[r];
    BIT::update(r + 1, cnt[r]);
    for (pair<int, int> &qr : qu[r]) {
      int l = qr.first;
      ans[qr.second] = getsum(l + 1, r + 1) ^ BIT::query(l + 1, r + 1);
    }
  }
  for (int i = 0; i < q; i++) cout << ans[i] << endl;
  return 0;
}
int main() {
  ios::sync_with_stdio(0);
  solve();
  return 0;
}
