#include <bits/stdc++.h>
using namespace std;
map<int, int> Last;
struct PP {
  int l, r, id;
} d[1000111];
int pre[1000111], a[1000111], ans[1000111], f[1000111];
int n, m, bz;
int lowbit(int x) { return x & (-x); }
void add(int k, int v) {
  while (k <= n) {
    f[k] ^= v;
    k += lowbit(k);
  }
}
int ask(int x) {
  int l = 0;
  while (x != 0) {
    l ^= f[x];
    x -= lowbit(x);
  }
  return l;
}
bool cmp(PP A, PP B) { return A.r < B.r; }
int main() {
  memset(f, 0, sizeof(f));
  scanf("%d", &n);
  pre[0] = 0;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    pre[i] = pre[i - 1] ^ a[i];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &d[i].l, &d[i].r);
    d[i].id = i;
  }
  sort(d + 1, d + 1 + m, cmp);
  Last.clear();
  bz = 1;
  for (int i = 1; i <= d[m].r; i++) {
    if (Last[a[i]] != 0) add(Last[a[i]], a[i]);
    add(i, a[i]);
    Last[a[i]] = i;
    while (d[bz].r == i) {
      ans[d[bz].id] =
          ask(d[bz].r) ^ ask(d[bz].l - 1) ^ pre[d[bz].r] ^ pre[d[bz].l - 1];
      bz++;
    }
  }
  for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
}
