#include <bits/stdc++.h>
using namespace std;
const int N = 1000000 + 5;
int pref[N];
vector<pair<int, int> > query[N];
int ans[N];
int bit[N];
int arr[N];
int n;
map<int, int> check;
void update(int x, int val) {
  for (int i = x; i <= n; i += (i & -i)) bit[i] ^= val;
}
int get(int x) {
  int ret = 0;
  for (int i = x; i > 0; i -= (i & -i)) ret ^= bit[i];
  return ret;
}
int main(void) {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", arr + i);
  for (int i = 1; i <= n; i++) pref[i] = pref[i - 1] ^ arr[i];
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d %d", &l, &r);
    query[r].push_back({l, i});
  }
  for (int i = 1; i <= n; i++) {
    if (check[arr[i]]) {
      update(check[arr[i]], arr[i]);
    }
    check[arr[i]] = i;
    update(check[arr[i]], arr[i]);
    while (query[i].size() != 0) {
      int l = query[i].back().first;
      int idx = query[i].back().second;
      query[i].pop_back();
      ans[idx] = pref[i] ^ pref[l - 1] ^ get(i) ^ get(l - 1);
    }
  }
  for (int i = 0; i < m; i++) printf("%d\n", ans[i]);
  return 0;
}
