#include <bits/stdc++.h>
using namespace std;
inline void write_int(int x) {
  char buf[10], *p = buf;
  do {
    *p++ = '0' + x % 10;
    x /= 10;
  } while (x);
  do {
    putchar(*--p);
  } while (p > buf);
}
inline int read_int() {
  int n = 0;
  int ch = getchar();
  while (ch < 48) ch = getchar();
  while (ch > 47) n = (n << 3) + (n << 1) + ch - '0', ch = getchar();
  return n;
}
struct Query {
  int l, r, idx, val;
  Query() {}
  Query(int _l, int _r, int _idx) : l(_l), r(_r), idx(_idx) {}
};
struct Qop1 {
  bool operator()(Query a, Query b) { return a.r < b.r; }
};
struct Fenwick {
  vector<int> tree;
  Fenwick(int n) : tree(n + 1) {}
  int sum(int pos) {
    ++pos;
    int ret = 0;
    while (pos > 0) {
      ret ^= tree[pos];
      pos &= (pos - 1);
    }
    return ret;
  }
  void add(int pos, int val) {
    ++pos;
    while (pos < tree.size()) {
      tree[pos] ^= val;
      pos += (pos & -pos);
    }
  }
};
int main() {
  int n, m;
  n = read_int();
  vector<int> arr(n);
  vector<int> sumArr(n + 1);
  sumArr[0] = 0;
  vector<Query> query;
  for (int i = 0; i < n; i++) {
    arr[i] = read_int();
    sumArr[i + 1] = sumArr[i] ^ arr[i];
  }
  int a, b;
  m = read_int();
  for (int i = 0; i < m; i++) {
    a = read_int();
    b = read_int();
    query.push_back(Query(a - 1, b - 1, i));
  }
  sort(query.begin(), query.end(), Qop1());
  int lastr = -1;
  map<int, int> last;
  Fenwick ftree(n);
  vector<int> newIdx(m);
  for (int i = 0; i < m; i++) {
    Query &temp = query[i];
    if (lastr != temp.r) {
      for (int idx = lastr + 1; idx <= temp.r; idx++) {
        auto iter = last.find(arr[idx]);
        if (iter == last.end()) {
          last.insert(make_pair(arr[idx], idx));
          ftree.add(idx, arr[idx]);
        } else {
          int lastIdx = iter->second;
          ftree.add(lastIdx, arr[idx]);
          ftree.add(idx, arr[idx]);
          iter->second = idx;
        }
      }
      lastr = temp.r;
    }
    temp.val = ftree.sum(temp.r) ^ ftree.sum(temp.l - 1);
    newIdx[temp.idx] = i;
  }
  for (int i = 0; i < m; i++) {
    Query &temp = query[newIdx[i]];
    int ans = sumArr[temp.r + 1] ^ sumArr[temp.l] ^ temp.val;
    write_int(ans);
    putchar('\n');
  }
  return 0;
}
