#include <bits/stdc++.h>
using namespace std;
const int N = 4e6 + 5;
map<int, int> pos;
int L[N], R[N];
int letter[N];
int dp[N];
int sum[N];
int ans[N];
int n, m;
struct node {
  int l, r;
  int cnt;
  bool operator<(const node &b) const { return r < b.r; }
} a[N];
void build(int l, int r, int now) {
  L[now] = l;
  R[now] = r;
  sum[now] = 0;
  if (l == r) return;
  int mid = (l + r) >> 1;
  build(l, mid, now << 1);
  build(mid + 1, r, now << 1 | 1);
  sum[now] = sum[now << 1] ^ sum[now << 1 | 1];
}
void update(int l, int r, int now, int d) {
  if (L[now] == l && R[now] == r) {
    sum[now] ^= d;
    return;
  }
  int mid = (L[now] + R[now]) >> 1;
  if (r <= mid)
    update(l, r, now << 1, d);
  else if (l > mid)
    update(l, r, now << 1 | 1, d);
  sum[now] = sum[now << 1] ^ sum[now << 1 | 1];
}
int query(int l, int r, int now) {
  if (L[now] == l && r == R[now]) return sum[now];
  int mid = (L[now] + R[now]) >> 1;
  if (r <= mid)
    return query(l, r, now << 1);
  else if (l > mid)
    return query(l, r, now << 1 | 1);
  else
    return query(l, mid, now << 1) ^ query(mid + 1, r, now << 1 | 1);
  sum[now] = sum[now << 1] ^ sum[now << 1 | 1];
}
int main() {
  scanf("%d", &n);
  build(1, n, 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &letter[i]);
    dp[i] = dp[i - 1] ^ letter[i];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &a[i].l, &a[i].r);
    a[i].cnt = i;
  }
  sort(a + 1, a + 1 + m);
  int last = 0;
  for (int i = 1; i <= m; i++) {
    while (last < a[i].r) {
      last++;
      if (pos[letter[last]])
        update(pos[letter[last]], pos[letter[last]], 1, letter[last]);
      update(last, last, 1, letter[last]);
      pos[letter[last]] = last;
    }
    ans[a[i].cnt] = query(a[i].l, a[i].r, 1) ^ dp[a[i].r] ^ dp[a[i].l - 1];
  }
  for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
  return 0;
}
