#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool smin(T &a, const T &b) {
  return b < a ? a = b, 1 : 0;
}
template <typename T>
inline bool smax(T &a, const T &b) {
  return a < b ? a = b, 1 : 0;
}
const long long N = (long long)1e6 + 10;
long long n, ar[N], m, bl[N], br[N], pre[N], fen[N], res[N];
vector<long long> qs[N];
map<long long, long long> last;
long long get_xor(long long l, long long r) {
  if (!l) return pre[r];
  return pre[r] ^ pre[l - 1];
}
void add(long long i, long long val) {
  for (; i < N; i += (i & -i)) fen[i] ^= val;
}
long long get(long long i) {
  long long ret = 0;
  for (; i; i ^= (i & -i)) ret ^= fen[i];
  return ret;
}
void add(long long l, long long r, long long val) {
  add(r, val);
  if (l > 1) add(l - 1, val);
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  for (long long i = 1; i <= n; ++i) {
    cin >> ar[i];
    if (i) pre[i] = pre[i - 1];
    pre[i] ^= ar[i];
  }
  cin >> m;
  for (long long j = 0; j < m; ++j) {
    cin >> bl[j] >> br[j];
    qs[br[j]].push_back(j);
  }
  for (long long j = 1; j <= n; ++j) last[ar[j]] = -1;
  for (long long i = 1; i <= n; ++i) {
    long long x = ar[i];
    if (last[x] == -1)
      add(1, i, x);
    else
      add(last[x] + 1, i, x);
    last[x] = i;
    for (long long p : qs[i]) {
      res[p] = get_xor(bl[p], i);
      res[p] ^= get(i);
      res[p] ^= get(bl[p] - 1);
    }
  }
  for (long long j = 0; j < m; ++j) cout << res[j] << '\n';
}
