#include <bits/stdc++.h>
using namespace std;
const int MAX = 1e6 + 5;
struct p {
  int l, r, id;
  bool operator<(const p &a) const {
    if (r != a.r) return r < a.r;
    return l < a.l;
  }
} qu[MAX];
int n, q, L;
int id[MAX], a[MAX], b[MAX], s[MAX], sum1[MAX], ans[MAX], pre[MAX], ppre[MAX];
int read() {
  int x(0);
  char ch = getchar();
  for (; !isdigit(ch); ch = getchar())
    ;
  for (; isdigit(ch); x = x * 10 + ch - 48, ch = getchar())
    ;
  return x;
}
int lowbit(int x) { return x & (-x); }
void change(int x, int dis) {
  for (int i = x; i <= n; i += lowbit(i)) s[i] ^= dis;
}
int sum_(int x) {
  int ans = 0;
  for (int i = x; i; i -= lowbit(i)) ans ^= s[i];
  return ans;
}
int ask(int l, int r) { return sum_(r) ^ sum_(l - 1); }
int look(int x) {
  int l = 1, r = L, ans = 0;
  while (l <= r) {
    int mid(l + r >> 1);
    if (b[mid] >= x)
      ans = mid, r = mid - 1;
    else
      l = mid + 1;
  }
  return ans;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i)
    a[i] = b[i] = read(), sum1[i] = sum1[i - 1] ^ a[i];
  sort(b + 1, b + 1 + n), L = unique(b + 1, b + 1 + n) - b, q = read();
  for (int i = 1; i <= n; ++i) id[i] = look(a[i]);
  for (int i = 1; i <= n; ++i) pre[i] = ppre[id[i]], ppre[id[i]] = i;
  for (int i = 1; i <= q; ++i) qu[i].l = read(), qu[i].r = read(), qu[i].id = i;
  sort(qu + 1, qu + 1 + q);
  for (int i = 1, r = 1; i <= q; ++i) {
    while (r <= qu[i].r) {
      if (pre[r]) change(pre[r], a[r]);
      change(r, a[r]), ++r;
    }
    ans[qu[i].id] = ask(qu[i].l, qu[i].r) ^ sum1[qu[i].r] ^ sum1[qu[i].l - 1];
  }
  for (int i = 1; i <= q; ++i) printf("%d\n", ans[i]);
  return 0;
}
