#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int acum1[N], acum2[N];
struct query {
  int id, l, r;
  query() {}
  query(const int _id, const int _l, const int _r) { id = _id, r = _r, l = _l; }
  bool operator<(query o) const { return r < o.r; }
};
int query1(int l, int r) { return acum1[r + 1] ^ acum1[l]; }
vector<int> v;
vector<int> arr;
void update(int p) {
  p++;
  int pos = p;
  while (pos <= N) {
    acum2[pos] ^= v[arr[p - 1]];
    pos += (pos & -pos);
  }
}
int qq(int p) {
  p++;
  int pos = p;
  int ans = 0;
  while (pos > 0) {
    ans ^= acum2[pos];
    pos -= (pos & -pos);
  }
  return ans;
}
int query2(int l, int r) { return qq(r) ^ qq(l - 1); }
int last[1000006];
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int x;
    cin >> x;
    arr.push_back(x);
    v.push_back(x);
  }
  for (int i = 0; i < n; i++) {
    acum1[i + 1] = acum1[i];
    acum1[i + 1] ^= arr[i];
  }
  set<int> s(v.begin(), v.end());
  v.assign(s.begin(), s.end());
  map<int, int> trans;
  for (int i = 0; i < v.size(); i++) {
    trans[v[i]] = i;
  }
  for (int i = 0; i < arr.size(); i++) {
    arr[i] = trans[arr[i]];
  }
  memset(last, -1, sizeof(last));
  int q;
  cin >> q;
  vector<query> queries;
  vector<int> answers(q, 0);
  for (int i = 0; i < q; i++) {
    int l, r;
    cin >> l >> r;
    l--, r--;
    queries.push_back(query(i, l, r));
    answers[i] ^= query1(l, r);
  }
  sort(begin(queries), end(queries));
  int rr = -1;
  for (auto q : queries) {
    while (rr < q.r) {
      rr++;
      if (last[arr[rr]] != -1) update(last[arr[rr]]);
      last[arr[rr]] = rr;
      update(rr);
    }
    answers[q.id] ^= query2(q.l, q.r);
  }
  for (auto e : answers) cout << e << "\n";
  return 0;
}
