#include <bits/stdc++.h>
using namespace std;
pair<pair<int, int>, int> q[1024000];
map<int, int> lst;
int pre[1024000], pre_xor[1024000], seg[1024000], n, ans[1024000], arr[1024000];
void modify(int x, int num) {
  for (; x <= n; x += x & -x) seg[x] ^= num;
}
int query(int x) {
  if (x <= 0) return 0;
  int res = 0;
  for (; x; x -= x & -x) res ^= seg[x];
  return res;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> arr[i];
    pre_xor[i] = pre_xor[i - 1] ^ arr[i];
    pre[i] = lst[arr[i]];
    lst[arr[i]] = i;
  }
  int m;
  cin >> m;
  for (int i = 1; i <= m; i++) {
    cin >> q[i].first.second >> q[i].first.first;
    q[i].second = i;
  }
  sort(q + 1, q + m + 1);
  int cur = 1;
  for (int i = 1; i <= m; i++) {
    for (; cur <= n && cur <= q[i].first.first; cur++) {
      if (pre[cur]) modify(pre[cur], arr[cur]);
      modify(cur, arr[cur]);
    }
    ans[q[i].second] = query(q[i].first.first) ^ query(q[i].first.second - 1) ^
                       pre_xor[q[i].first.first] ^
                       pre_xor[q[i].first.second - 1];
  }
  for (int i = 1; i <= m; i++) cout << ans[i] << endl;
  return 0;
}
