#include <bits/stdc++.h>
using namespace std;
const int N = 2e6 + 5, inf = 1e9 + 7;
int n, k, i, j;
int A[N], pre[N], ans[N];
unordered_map<int, int> m;
std::vector<pair<pair<int, int>, int> > v;
vector<int> bit(N);
void upd(int first, int val) {
  for (; first <= n; first += (first & -first)) bit[first] ^= val;
}
int qu(int first) {
  int res = 0;
  for (; first > 0; first -= (first & -first)) res ^= bit[first];
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int i, j, a, b;
  cin >> n;
  m.reserve(128);
  m.max_load_factor(0.25);
  for (i = 1; i < n + 1; i++) cin >> A[i], pre[i] = pre[i - 1] ^ A[i];
  cin >> k;
  for (i = 0; i < k; i++) {
    cin >> a >> b;
    v.emplace_back(pair<pair<int, int>, int>(pair<int, int>(b, a), i));
  }
  sort(v.begin(), v.end());
  int cur = 1;
  for (auto q : v) {
    while (cur <= q.first.first) {
      if (m[A[cur]]) upd(m[A[cur]], A[cur]);
      upd(cur, A[cur]);
      m[A[cur]] = cur;
      cur++;
    }
    ans[q.second] = qu(q.first.first) ^ qu(q.first.second - 1) ^
                    pre[q.first.first] ^ pre[q.first.second - 1];
  }
  for (i = 0; i < k; i++) cout << ans[i] << "\n";
}
