#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000006;
map<int, int> mp;
struct snode {
  int l, r;
  int pos;
} node[maxn];
int a[maxn], sum[maxn], tree[maxn], pre[maxn];
int n, q;
int res[maxn];
int lowbit(int t) { return t & (-t); }
void add(int x, int y) {
  for (int i = x; i <= n; i += lowbit(i)) {
    tree[i] ^= y;
  }
}
int getsum(int x) {
  int ans = 0;
  for (int i = x; i > 0; i -= lowbit(i)) ans ^= tree[i];
  return ans;
}
bool cmp(snode a, snode b) { return a.r < b.r; }
int main() {
  memset(tree, 0, sizeof(tree));
  mp.clear();
  sum[0] = 0;
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] ^ a[i];
    pre[i] = mp[a[i]];
    mp[a[i]] = i;
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; i++) {
    scanf("%d%d", &node[i].l, &node[i].r);
    node[i].pos = i;
  }
  sort(node + 1, node + 1 + q, cmp);
  int j = 1;
  for (int i = 1; i <= q; i++) {
    for (; j <= node[i].r; j++) {
      if (pre[j]) add(pre[j], a[j]);
      add(j, a[j]);
    }
    res[node[i].pos] = sum[node[i].r] ^ sum[node[i].l - 1] ^ getsum(node[i].r) ^
                       getsum(node[i].l - 1);
  }
  for (int i = 1; i <= q; i++) printf("%d\n", res[i]);
  return 0;
}
