#include <bits/stdc++.h>
using namespace std;
struct query {
  int l, r, num;
  bool operator<(const query& _Off) const { return l < _Off.l; }
};
query Q[1000001];
int n, m;
int ans[1000001];
map<int, int> Map;
int a[1000001], x[1000001];
int cnt;
int last[1000001];
int fen[1000001];
void pre() {
  for (int i = 1; i <= n; i++) {
    int num = Map[a[i]];
    if (!num) {
      num = Map[a[i]] = ++cnt;
      x[cnt] = a[i];
    }
    a[i] = num;
  }
}
inline void add(int pos, int x) {
  while (pos <= n) {
    fen[pos] ^= x;
    pos |= (pos + 1);
  }
}
inline int get(int pos) {
  int res = 0;
  while (pos > 0) {
    res ^= fen[pos];
    pos &= (pos + 1);
    pos--;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &Q[i].l, &Q[i].r);
    Q[i].num = i;
  }
  pre();
  sort(Q + 1, Q + m + 1);
  int ptr = m;
  for (int i = n; i >= 1; i--) {
    if (last[a[i]]) {
      add(last[a[i]], x[a[i]]);
    }
    last[a[i]] = i;
    while (ptr && Q[ptr].l == i) {
      ans[Q[ptr].num] = get(Q[ptr].r);
      ptr--;
    }
  }
  for (int i = 1; i <= m; i++) {
    printf("%d\n", ans[i]);
  }
}
