#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000009], c[1000009], l[1000009], r[1000009];
long long sum[1000009] = {0}, ans[1000009] = {0};
vector<int> q[1000009];
map<int, int> mp;
int lowbit(int x) { return x & (-x); }
void Plus(int x, long long val) {
  while (x <= n) {
    c[x] ^= val;
    x = x + lowbit(x);
  }
}
long long Sum(int x) {
  long long a = 0;
  while (x) {
    a ^= c[x];
    x -= lowbit(x);
  }
  return a;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    sum[i] = sum[i - 1] ^ a[i];
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) {
    scanf("%d%d", &l[i], &r[i]);
    q[r[i]].push_back(i);
    ans[i] = sum[r[i]] ^ (sum[l[i] - 1]);
  }
  for (int i = 1; i <= n; i++) {
    int x = a[i];
    if (mp.count(x)) {
      Plus(mp[x], x);
    }
    Plus(i, x);
    mp[x] = i;
    for (int j = 0; j < q[i].size(); j++) {
      int id = q[i][j];
      ans[id] ^= Sum(r[id]) ^ Sum(l[id] - 1);
    }
  }
  for (int i = 1; i <= m; i++) printf("%I64d\n", ans[i]);
  return 0;
}
