#include <bits/stdc++.h>
const int MAXN = 1001001;
const int MAXQ = 1000001;
struct Query {
  int l, r, answer, id;
  bool operator<(const Query &rhs) const { return r < rhs.r; }
} q[MAXQ];
int n, m, size, a[MAXN], p[MAXN], d[MAXN], hash[MAXN], rt[MAXN], bit[MAXN];
bool cmp(const Query &a, const Query &b) { return a.id < b.id; }
void add(int x, int n, int d) {
  for (int i = x; i <= n; i += i & -i) bit[i] ^= d;
}
int sum(int x) {
  int ret = 0;
  for (int i = x; i; i -= i & -i) ret ^= bit[i];
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", a + i);
    d[i] = a[i];
  }
  std::sort(d + 1, d + n + 1);
  int tot = std::unique(d + 1, d + n + 1) - d - 1;
  for (int i = 1; i <= n; i++) {
    int pos = std::lower_bound(d + 1, d + tot + 1, a[i]) - d;
    p[i] = hash[pos];
    hash[pos] = i;
    add(i, n, a[i]);
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &q[i].l, &q[i].r);
    q[i].id = i;
  }
  std::sort(q + 1, q + m + 1);
  for (int i = 1, last = 1; i <= m; i++) {
    while (last <= q[i].r) {
      if (p[last]) add(p[last], n, a[last]);
      add(last, n, a[last]);
      last++;
    }
    q[i].answer = sum(q[i].r) ^ sum(q[i].l - 1);
  }
  std::sort(q + 1, q + m + 1, cmp);
  for (int i = 1; i <= m; i++) {
    printf("%d\n", q[i].answer);
  }
  return 0;
}
