#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int N = 1000005, SQRT = 1200;
int arr[N], acc[N], answer[N];
vector<pair<int, int> > queries[N];
int bit[N], n;
void upd(int pos, int v) {
  for (; pos <= n; pos += pos & -pos) bit[pos] ^= v;
}
int query(int pos) {
  int ret = 0;
  for (; pos > 0; pos -= pos & -pos) ret ^= bit[pos];
  return ret;
}
int query(int a, int b) { return query(b) ^ query(a - 1); }
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &arr[i]);
    acc[i + 1] = acc[i] ^ arr[i];
  }
  int q;
  scanf("%d", &q);
  for (int i = 0; i < q; ++i) {
    int l, r;
    scanf("%d %d", &l, &r);
    queries[r].push_back(pair<int, int>(l, i));
  }
  map<int, int> last_seen;
  for (int i = 1; i <= n; ++i) {
    if (last_seen.find(arr[i]) != last_seen.end()) {
      upd(last_seen[arr[i]], arr[i]);
    }
    last_seen[arr[i]] = i;
    upd(i, arr[i]);
    for (int j = 0; j < queries[i].size(); ++j) {
      int xor_range = acc[i + 1] ^ acc[queries[i][j].first];
      int xor_unique = query(queries[i][j].first, i);
      answer[queries[i][j].second] = xor_range ^ xor_unique;
    }
  }
  for (int i = 0; i < q; ++i) {
    printf("%d\n", answer[i]);
  }
  return 0;
}
