#include <bits/stdc++.h>
using namespace std;
int n, m;
int a[1000005];
int t[4000005];
map<int, int> last;
vector<pair<int, int> > v[1000005];
int ans[1000005];
int sz;
inline void update(int x, int y) {
  x += sz - 1;
  while (x) {
    t[x] ^= y;
    x >>= 1;
  }
}
int get(int l, int r, int ll, int rr, int x) {
  if (l > r || ll > r || l > rr) return 0;
  if (l >= ll && r <= rr) return t[x];
  int mid = (l + r) >> 1;
  return (get(l, mid, ll, rr, x + x) ^ get(mid + 1, r, ll, rr, x + x + 1));
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  sz = 1;
  while (sz < n) sz += sz;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  cin >> m;
  for (int i = 1; i <= m; ++i) {
    int x, y;
    cin >> x >> y;
    v[y].push_back(make_pair(x, i));
  }
  for (int i = 1; i <= n; ++i) {
    int x = last[a[i]];
    if (x) update(x, a[i]);
    last[a[i]] = i;
    for (int j = 0; j < v[i].size(); ++j) {
      x = v[i][j].first;
      int y = v[i][j].second;
      ans[y] = get(1, sz, x, i, 1);
    }
  }
  for (int i = 1; i <= m; ++i) cout << ans[i] << '\n';
}
