#include <bits/stdc++.h>
const long long mod = 1000000007L;
using namespace std;
int n;
pair<int, pair<int, int> > q[1000010];
int ans[1000010];
int bit[1000010];
map<int, int> last;
int pre[1000010], ar[1000010];
void update(int idx, long long val) {
  while (idx < 1000010) {
    bit[idx] ^= val;
    idx += (idx & -idx);
  }
}
long long query(int idx) {
  long long res = 0;
  while (idx > 0) {
    res ^= bit[idx];
    idx -= (idx & -idx);
  }
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &ar[i]);
    pre[i] = pre[i - 1] ^ ar[i];
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d", &l), scanf("%d", &r);
    q[i].first = r;
    q[i].second.first = l;
    q[i].second.second = i;
  }
  sort(q, q + m);
  int pos = 0;
  for (int i = 1; i <= n; i++) {
    if (last[ar[i]] > 0) {
      update(last[ar[i]], ar[i]);
    }
    last[ar[i]] = i;
    update(i, ar[i]);
    while (pos < m && q[pos].first == i) {
      ans[q[pos].second.second] =
          pre[q[pos].first] ^ pre[q[pos].second.first - 1] ^
          query(q[pos].second.first - 1) ^ query(q[pos].first);
      ++pos;
    }
  }
  for (int i = 0; i < m; i++) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
