#include <bits/stdc++.h>
using namespace std;
long long n, m, l[3000010], a[3000010], tr[3000010 << 1], ans[3000010],
    tot[3000010], head[3000010], p[3000010];
struct node {
  long long L, R, num;
} query[3000010];
bool cmp(node s1, node s2) { return s1.R < s2.R; }
long long lowbit(long long x) { return x & (-x); }
void add(long long x, long long now) {
  while (x <= n) {
    tr[x] ^= now;
    x += lowbit(x);
  }
}
long long sum(long long x) {
  long long cnt = 0;
  while (x > 0) {
    cnt ^= tr[x];
    x -= lowbit(x);
  }
  return cnt;
}
void lsh() {
  sort(l + 1, l + n + 1);
  unique(l + 1, l + 1 + n) - l - 1;
  for (long long i = 1; i <= n; i++) {
    a[i] = lower_bound(l + 1, l + 1 + n, a[i]) - l;
  }
}
void INIT() {
  for (int i = 1; i <= n; i++) {
    tot[i] = tot[i - 1] ^ l[a[i]];
    p[i] = head[a[i]];
    head[a[i]] = i;
  }
}
int main() {
  scanf("%I64d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%I64d", &a[i]);
    l[i] = a[i];
  }
  lsh();
  INIT();
  scanf("%I64d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%I64d%I64d", &query[i].L, &query[i].R);
    query[i].num = i;
  }
  sort(query + 1, query + 1 + m, cmp);
  int now = 1;
  for (int i = 1; i <= m; i++) {
    long long R = query[i].R, L = query[i].L;
    while (now <= R) {
      if (p[now]) add(p[now], l[a[now]]);
      add(now, l[a[now]]);
      now++;
    }
    ans[query[i].num] = (sum(R) ^ sum(L - 1)) ^ (tot[R] ^ tot[L - 1]);
  }
  for (int i = 1; i <= m; i++) printf("%I64d\n", ans[i]);
  return 0;
}
