#include <bits/stdc++.h>
using namespace std;
struct query {
  int l, r, num;
};
bool cmp(query a, query b) { return a.r < b.r; }
int n, m, pn, mp_num = 0;
unordered_map<int, int> mp;
vector<int> a, last, t;
vector<query> q;
void update(int v, int l, int r, int pos, int val) {
  if (l == r)
    t[v] = val;
  else {
    int m = (l + r) / 2;
    if (pos <= m)
      update(v * 2, l, m, pos, val);
    else
      update(v * 2 + 1, m + 1, r, pos, val);
    t[v] = t[v * 2] ^ t[v * 2 + 1];
  }
}
int get_xor(int v, int l, int r, int ql, int qr) {
  if (l == ql && r == qr)
    return t[v];
  else {
    int m = (l + r) / 2, x = 0;
    if (ql <= min(qr, m)) x ^= get_xor(v * 2, l, m, ql, min(qr, m));
    if (max(ql, m + 1) <= qr)
      x ^= get_xor(v * 2 + 1, m + 1, r, max(ql, m + 1), qr);
    return x;
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  pn = n;
  a.resize(n);
  last.resize(n);
  for (int i = 0; i < n; ++i) {
    cin >> a[i];
    if (!mp.count(a[i])) {
      mp[a[i]] = mp_num;
      ++mp_num;
      last[mp[a[i]]] = i;
    }
  }
  cin >> m;
  q.resize(m);
  for (int i = 0; i < m; ++i) {
    cin >> q[i].l >> q[i].r;
    --q[i].l, --q[i].r;
    q[i].num = i;
  }
  sort(q.begin(), q.end(), cmp);
  vector<int> pref(n + 1, 0);
  for (int i = 1; i <= n; ++i) pref[i] = pref[i - 1] ^ a[i - 1];
  int bin = 1;
  while (bin < n) bin *= 2;
  n = bin;
  t.resize(n * 2, 0);
  int pos = 0;
  vector<int> ans(m);
  for (int i = 0; i < pn; ++i) {
    int cur = mp[a[i]];
    update(1, 0, n - 1, last[cur], 0);
    update(1, 0, n - 1, i, a[i]);
    last[cur] = i;
    while (pos < m && q[pos].r == i) {
      int l = q[pos].l, r = q[pos].r, num = q[pos].num;
      ans[num] = pref[r + 1] ^ pref[l] ^ get_xor(1, 0, n - 1, l, r);
      ++pos;
    }
  }
  for (int i : ans) cout << i << "\n";
  return 0;
}
