#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return x * f;
}
struct arr {
  long long l, r, id;
} b[3000005];
long long n, m, a[3000005], ans[3000005], las[3000005], sum[3000005], t;
long long c[3000005];
map<long long, long long> Map;
inline long long lowbit(long long x) { return x & (-x); }
inline void modify(long long x, long long d) {
  for (; x <= n; x += lowbit(x)) c[x] ^= d;
}
inline long long getsum(long long x) {
  long long sum = 0;
  for (; x; x ^= lowbit(x)) sum ^= c[x];
  return sum;
}
inline bool cmp(arr A, arr B) { return A.r < B.r; }
signed main() {
  n = read();
  for (long long i = 1; i <= n; i++)
    a[i] = read(), sum[i] = sum[i - 1] ^ a[i], Map[a[i]] = ++t;
  m = read();
  for (long long i = 1; i <= m; i++) {
    b[i].l = read();
    b[i].r = read();
    b[i].id = i;
    ans[i] = sum[b[i].r] ^ sum[b[i].l - 1];
  }
  sort(b + 1, b + m + 1, cmp);
  long long j = 0;
  for (long long i = 1; i <= m; i++) {
    while (j < b[i].r) {
      j++;
      if (las[Map[a[j]]]) modify(las[Map[a[j]]], a[j]);
      las[Map[a[j]]] = j;
      modify(j, a[j]);
    }
    ans[b[i].id] ^= (getsum(b[i].r) ^ getsum(b[i].l - 1));
  }
  for (long long i = 1; i <= m; i++) printf("%lld\n", ans[i]);
  return 0;
}
