#include <bits/stdc++.h>
using namespace std;
long long modpow(long long base, long long exponent, long long modulus) {
  if (base == 0 && exponent == 0) return 0;
  long long result = 1;
  while (exponent > 0) {
    if (exponent % 2 == 1) result = (result * base) % modulus;
    exponent = exponent >> 1;
    base = (base * base) % modulus;
  }
  return result;
}
struct BIT {
  vector<int> tree;
  int n;
  void init(int m) {
    n = m;
    tree.resize(n);
    for (int i = 0; i < n; i++) tree[i] = 0;
  }
  void update(int idx, int val) {
    while (idx < n) {
      tree[idx] ^= val;
      idx += (idx & (-idx));
    }
  }
  int query(int idx) {
    int ret = 0;
    while (idx > 0) {
      ret ^= tree[idx];
      idx -= (idx & (-idx));
    }
    return ret;
  }
};
int N, M;
int arr[1000110];
vector<pair<pair<int, int>, pair<int, int> > > queries;
int ans[1000110];
int sums[1000110];
map<int, int> mp;
BIT P;
int xor_value(int l, int r) {
  int ret = (sums[r] ^ sums[l - 1]);
  return ret;
}
inline void ReadInput(void) {
  scanf("%d", &N);
  for (int i = 1; i <= N; i++) {
    scanf("%d", &arr[i]);
    queries.push_back(pair<pair<int, int>, pair<int, int> >(
        pair<int, int>(i, 1), pair<int, int>(i, arr[i])));
    sums[i] = (sums[i - 1] ^ arr[i]);
  }
  scanf("%d", &M);
  for (int i = 1; i <= M; i++) {
    int l, r;
    scanf("%d", &l);
    scanf("%d", &r);
    queries.push_back(pair<pair<int, int>, pair<int, int> >(
        pair<int, int>(r, 2), pair<int, int>(l, i)));
  }
}
inline void solve(void) {
  P.init(1000110);
  sort(queries.begin(), queries.end());
  for (int i = 0; i < queries.size(); i++) {
    int l, r, idx, type, val;
    r = queries[i].first.first;
    l = queries[i].second.first;
    type = queries[i].first.second;
    idx = queries[i].second.second;
    if (type == 1) {
      if (mp.find(idx) != mp.end()) {
        P.update(l, idx);
        P.update(mp[idx], idx);
      } else {
        P.update(l, idx);
      }
      mp[idx] = l;
    } else if (type == 2) {
      ans[idx] = (P.query(r) ^ P.query(l - 1) ^ xor_value(l, r));
    }
  }
  for (int i = 1; i <= M; i++) {
    printf("%d\n", ans[i]);
  }
}
inline void Refresh(void) {}
int main() {
  ReadInput();
  solve();
  return 0;
}
