#include <bits/stdc++.h>
using namespace std;
int a[1000001];
pair<int, pair<int, int>> q[1000001];
int res[1000001];
int bit[6000001];
map<int, pair<int, int>> even;
void update(int node, int l, int r, int pos, int val) {
  if (pos < l || pos > r) return;
  if (l == r) {
    bit[node] ^= val;
    return;
  }
  int mid = l + (r - l) / 2;
  update(2 * node + 1, l, mid, pos, val);
  update(2 * node + 2, mid + 1, r, pos, val);
  bit[node] = bit[2 * node + 1] ^ bit[2 * node + 2];
}
int query(int node, int l, int r, int ql, int qr) {
  if (ql > r || qr < l) return 0;
  if (ql <= l && qr >= r) return bit[node];
  int mid = l + (r - l) / 2;
  return query(2 * node + 1, l, mid, ql, qr) ^
         query(2 * node + 2, mid + 1, r, ql, qr);
}
int main() {
  int n, k;
  cin >> n;
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]);
  cin >> k;
  for (int i = 1; i <= k; ++i) {
    int l, r;
    scanf("%d%d", &l, &r);
    q[i] = make_pair(r, make_pair(l, i));
  }
  sort(&q[1], &q[k + 1]);
  for (int i = 1, j = 1; i <= n; ++i) {
    if (even.find(a[i]) == even.end()) even[a[i]] = make_pair(0, 0);
    even[a[i]].first++;
    if (even[a[i]].second != 0) {
      update(0, 0, n, even[a[i]].second, a[i]);
    }
    even[a[i]].second = i;
    while (j <= k && q[j].first <= i) {
      res[q[j].second.second] = query(0, 0, n, q[j].second.first, q[j].first);
      ++j;
    }
  }
  for (int i = 1; i <= k; ++i) printf("%d\n", res[i]);
  return 0;
}
