#include <bits/stdc++.h>
int inp() {
  char c = getchar();
  while (c < '0' || c > '9') c = getchar();
  int sum = 0;
  while (c >= '0' && c <= '9') {
    sum = sum * 10 + c - '0';
    c = getchar();
  }
  return sum;
}
struct Node {
  int l;
  int r;
  int id;
} s[1000010];
int a[1000010], ls[1000010], num[1000010], ans[1000010], last[1000010],
    sum[1000010];
struct BIT {
  int f[1000010];
  void modify(int x, int c) {
    for (; x <= 1000000; x += (x & (-x))) f[x] ^= c;
  }
  int query(int x) {
    int sum = 0;
    for (; x; x -= (x & (-x))) sum ^= f[x];
    return sum;
  }
} t;
bool cmp(Node a, Node b) { return a.r < b.r; }
int main() {
  int n = inp();
  for (int i = 1; i <= n; i++) a[i] = inp();
  memcpy(ls, a, sizeof(ls));
  std::sort(ls + 1, ls + n + 1);
  for (int i = 1; i <= n; i++)
    a[i] = std::lower_bound(ls + 1, ls + n + 1, a[i]) - ls;
  int odd = 0, even = 0;
  int m = inp();
  for (int i = 1; i <= m; i++) {
    s[i].l = inp();
    s[i].r = inp();
    s[i].id = i;
  }
  std::sort(s + 1, s + m + 1, cmp);
  int cur = 1;
  for (int i = 1; i <= n; i++) {
    if (last[a[i]]) t.modify(last[a[i]], ls[a[i]]);
    last[a[i]] = i;
    t.modify(i, ls[a[i]]);
    sum[i] = sum[i - 1] ^ ls[a[i]];
    while (s[cur].r == i) {
      ans[s[cur].id] = sum[s[cur].r] ^ sum[s[cur].l - 1] ^ t.query(s[cur].r) ^
                       t.query(s[cur].l - 1);
      cur++;
    }
  }
  for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
}
