#include <bits/stdc++.h>
using namespace std;
void read(int a = 0) {
  freopen("in", "r", stdin);
  if (a) freopen("out", "w", stdout);
}
int seg[100 * 100009] = {}, from, to, n, a[10 * 100009], tans[10 * 100009] = {},
              l[10 * 100009], r[10 * 100009], ans[10 * 100009];
vector<vector<int> > ad;
map<int, int> cur;
void insert(int num, int value, int second = from, int e = to, int p = 1) {
  seg[p] ^= value;
  if (second == e) return;
  int mid = (second + e) >> 1;
  if (num <= mid)
    insert(num, value, second, mid, p << 1);
  else
    insert(num, value, mid + 1, e, p << 1 | 1);
}
int get(int x, int y, int second = from, int e = to, int p = 1) {
  int mid = (second + e) >> 1;
  if (x <= second && y >= e)
    return seg[p];
  else if (x > e || second > y)
    return 0;
  else
    return get(x, y, second, mid, p << 1) ^ get(x, y, mid + 1, e, p << 1 | 1);
}
int main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  scanf("%d", &n);
  from = 0, to = n + 1;
  ad = vector<vector<int> >(n + 1);
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    tans[i] = tans[i - 1] ^ a[i];
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &l[i], &r[i]);
    ad[r[i]].push_back(i);
  }
  for (int i = 1; i <= n; i++) {
    int tmp = cur[a[i]];
    if (tmp) insert(tmp, a[i]);
    cur[a[i]] = i;
    insert(i, a[i]);
    for (int j = 0; j < ad[i].size(); j++) {
      ans[ad[i][j]] = tans[i] ^ tans[l[ad[i][j]] - 1] ^ get(l[ad[i][j]], i);
    }
  }
  for (int i = 0; i < m; i++) cout << ans[i] << "\n";
}
