#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
const int maxn = 1e6 + 12;
int n, m;
int s1[4 * maxn], ans[maxn];
vector<pair<int, pair<int, int> > > jobs;
map<int, int> mp;
void ad1(int id, int l, int r, int idx, int val);
int g1(int id, int l, int r, int st, int en);
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a;
    cin >> a;
    jobs.push_back(make_pair(i, make_pair(-1, a)));
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    jobs.push_back(make_pair(r, make_pair(l, i)));
  }
  sort(jobs.begin(), jobs.end());
  for (int i = 0; i < jobs.size(); i++) {
    int t = jobs[i].second.first;
    if (t == -1) {
      int idx = jobs[i].first;
      int val = jobs[i].second.second;
      if (mp[val] != 0) ad1(1, 0, n, mp[val] - 1, val);
      mp[val] = idx + 1;
      continue;
    }
    int r = jobs[i].first;
    int idx = jobs[i].second.second;
    ans[idx] = g1(1, 0, n, t, r + 1);
  }
  for (int i = 0; i < m; i++) {
    cout << ans[i] << '\n';
  }
  return 0;
}
void ad1(int id, int l, int r, int idx, int val) {
  if (idx < l || r <= idx) {
    return;
  }
  if (l == r - 1) {
    s1[id] ^= val;
    return;
  }
  int mid = (l + r) >> 1;
  ad1(id * 2 + 0, l, mid, idx, val);
  ad1(id * 2 + 1, mid, r, idx, val);
  s1[id] = s1[id * 2 + 0] ^ s1[id * 2 + 1];
  return;
}
int g1(int id, int l, int r, int st, int en) {
  if (en <= l || r <= st) {
    return 0;
  }
  if (st <= l && r <= en) {
    return s1[id];
  }
  int mid = (l + r) >> 1;
  return (g1(id * 2 + 0, l, mid, st, en) ^ g1(id * 2 + 1, mid, r, st, en));
}
