#include <bits/stdc++.h>
using namespace std;
long long aa[1000123];
long long sum[1000123];
long long n;
long long tree[1000000 + 5];
long long lowbit(long long x) { return x & -x; }
void add(long long x, long long value) {
  for (long long i = x; i <= n; i = i + lowbit(i)) {
    tree[i] ^= value;
  }
}
long long get(long long x) {
  long long sum = 0;
  for (long long i = x; i; i -= lowbit(i)) {
    sum ^= tree[i];
  }
  return sum;
}
struct node {
  long long x, y, id;
};
bool cmp(node a, node b) { return a.y < b.y; }
long long b[1000123];
node tm[1000123];
long long ans[1000132];
map<long long, long long> mp;
int main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    scanf("%lld", &aa[i]);
    b[i] = aa[i];
    sum[i] = sum[i - 1] ^ aa[i];
  }
  sort(b + 1, b + 1 + n);
  int cun = unique(b + 1, b + 1 + n) - b - 1;
  for (int i = 1; i <= n; i++)
    aa[i] = lower_bound(b + 1, b + 1 + cun, aa[i]) - b;
  long long m;
  cin >> m;
  for (long long i = 1; i <= m; i++) {
    scanf("%lld%lld", &tm[i].x, &tm[i].y);
    tm[i].id = i;
  }
  sort(tm + 1, tm + 1 + m, cmp);
  long long R = 0;
  for (long long i = 1; i <= m; i++) {
    long long x = tm[i].x;
    long long y = tm[i].y;
    while (y > R) {
      if (mp[b[aa[R + 1]]] != 0) add(mp[b[aa[R + 1]]], b[aa[R + 1]]);
      mp[b[aa[R + 1]]] = R + 1;
      add(R + 1, b[aa[R + 1]]);
      R++;
    }
    long long first = sum[y] ^ sum[x - 1];
    long long sum1 = get(y);
    long long sum2 = get(x - 1);
    ans[tm[i].id] = sum2 ^ sum1 ^ first;
  }
  for (long long i = 1; i <= m; i++) {
    printf("%lld\n", ans[i]);
  }
  return 0;
}
