#include <bits/stdc++.h>
using namespace std;
const int MOD = 1000000007;
double PI = 4 * atan(1);
int seg[1 << 21], el[1000001], ans[1000001], cum[1000001], n, m;
pair<pair<int, int>, int> q[1000001];
unordered_map<int, int> last;
void update(int ind, int l, int r, int d, int v) {
  if (l > d || r < d) return;
  if (l == d && r == d) {
    seg[ind] = v;
    return;
  }
  int m = (l + r) / 2;
  update(2 * ind, l, m, d, v);
  update(2 * ind + 1, m + 1, r, d, v);
  seg[ind] = seg[2 * ind] ^ seg[2 * ind + 1];
}
int query(int ind, int l, int r, int left, int right) {
  if (l > right || r < left) return 0;
  if (left <= l && r <= right) return seg[ind];
  int m = (l + r) / 2;
  return query(2 * ind, l, m, left, right) ^
         query(2 * ind + 1, m + 1, r, left, right);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  scanf("%d", &n);
  for (int i = 1; i < n + 1; i++) {
    scanf("%d", &el[i]);
    cum[i] = cum[i - 1] ^ el[i];
  }
  scanf("%d", &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &q[i].first.second, &q[i].first.first);
    q[i].second = i;
  }
  sort(q, q + m);
  int cur = 1;
  for (int i = 0; i < m; i++) {
    while (cur <= q[i].first.first) {
      if (last[el[cur]]) update(1, 1, n, last[el[cur]], 0);
      last[el[cur]] = cur;
      update(1, 1, n, cur, el[cur]);
      cur++;
    }
    ans[q[i].second] = cum[q[i].first.second - 1] ^ cum[q[i].first.first] ^
                       query(1, 1, n, q[i].first.second, q[i].first.first);
  }
  for (int i = 0; i < m; i++) printf("%d\n", ans[i]);
}
