#include <bits/stdc++.h>
using namespace std;
const long long MAXN = 1e6 + 10;
long long n, a[MAXN], p[MAXN], ans[MAXN], l, r, f[MAXN], m;
vector<pair<long long, long long>> v[MAXN];
map<long long, long long> last;
void add(long long x, long long r) {
  for (; x < MAXN; x += x & -x) f[x] ^= r;
}
long long get(long long x) {
  long long ans = 0;
  for (; x; x -= x & -x) ans ^= f[x];
  return ans;
}
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  ;
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    p[i] = p[i - 1] ^ a[i];
  }
  cin >> m;
  for (long long i = 1; i <= m; i++) {
    cin >> l >> r;
    v[r].push_back({i, l});
    ans[i] = p[r] ^ p[l - 1];
  }
  for (long long i = 1; i <= n; i++) {
    add(i, a[i]);
    if (last[a[i]]) add(last[a[i]], a[i]);
    for (auto j : v[i]) ans[j.first] ^= get(i) ^ get(j.second - 1);
    last[a[i]] = i;
  }
  for (long long i = 1; i <= m; i++) cout << ans[i] << '\n';
}
