#include <bits/stdc++.h>
using namespace std;
int bit[1111111], n, m, a[1111111], ans[1111111], s1[1111111];
int sum(int i) {
  int s = 0;
  while (i > 0) s ^= bit[i], i -= (i & -i);
  return s;
}
void upd(int i, int v) {
  if (i == 0) return;
  while (i < 1111111) bit[i] ^= v, i += (i & -i);
}
vector<pair<int, int> > q[1111111];
map<int, int> lst;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    s1[i] = s1[i - 1] ^ a[i];
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    int l, r;
    scanf("%d%d", &l, &r);
    q[r].push_back(make_pair(l, i));
  }
  for (int i = 1; i <= n; i++) {
    int now = a[i];
    if (lst.count(now)) upd(lst[now], now);
    upd(i, now);
    lst[now] = i;
    for (int j = 0; j < q[i].size(); j++) {
      pair<int, int> seg = q[i][j];
      int l = seg.first, r = i;
      ans[seg.second] = sum(r) ^ sum(l - 1) ^ s1[r] ^ s1[l - 1];
    }
  }
  for (int i = 0; i < m; i++) printf("%d\n", ans[i]);
}
