#include <bits/stdc++.h>
std::pair<std::pair<int, int>, int> querry[1000001];
std::unordered_map<int, int> last;
int fen[1000001];
int res[1000001];
int n;
int q;
void update(int index, int val) {
  if (index == 0) {
    return;
  }
  while (index <= n) {
    fen[index] ^= val;
    index += (index & -index);
  }
}
int get(int index) {
  int sum;
  sum = 0;
  while (index > 0) {
    sum ^= fen[index];
    index -= (index & -index);
  }
  return sum;
}
int main() {
  int arr[1000001];
  int xors[1000001];
  int index;
  std::ios::sync_with_stdio(false);
  std::cin >> n;
  for (index = 1; index <= n; ++index) {
    std::cin >> arr[index];
    xors[index] = xors[index - 1] ^ arr[index];
    last[arr[index]] = 0;
  }
  std::cin >> q;
  for (index = 1; index <= q; ++index) {
    std::cin >> querry[index].first.first;
    std::cin >> querry[index].first.second;
    querry[index].second = index;
  }
  std::sort(std::begin(querry) + 1, std::begin(querry) + q + 1,
            [](const std::pair<std::pair<int, int>, int>& a,
               const std::pair<std::pair<int, int>, int>& b) {
              return a.first.second < b.first.second;
            });
  for (int tempIndex = 1; tempIndex <= q; ++tempIndex) {
    for (index = querry[tempIndex - 1].first.second + 1;
         index <= querry[tempIndex].first.second; ++index) {
      update(last[arr[index]], arr[index]);
      last[arr[index]] = index;
      update(index, arr[index]);
    }
    res[querry[tempIndex].second] = (xors[querry[tempIndex].first.second] ^
                                     xors[querry[tempIndex].first.first - 1] ^
                                     get(querry[tempIndex].first.second) ^
                                     get(querry[tempIndex].first.first - 1));
  }
  for (index = 1; index <= q; ++index) {
    std::cout << res[index] << '\n';
  }
  return 0;
}
