#include <bits/stdc++.h>
using namespace std;
int a[1000001];
int n;
int ans[1000001] = {0};
int sum[1000001] = {0};
unordered_map<int, int> last;
int tree[4000001] = {0};
pair<int, pair<int, int> > query[1000001];
int readInt() {
  bool minus = false;
  int result = 0;
  char ch;
  ch = getchar();
  while (true) {
    if (ch == '-') break;
    if (ch >= '0' && ch <= '9') break;
    ch = getchar();
  }
  if (ch == '-')
    minus = true;
  else
    result = ch - '0';
  while (true) {
    ch = getchar();
    if (ch < '0' || ch > '9') break;
    result = result * 10 + (ch - '0');
  }
  if (minus)
    return -result;
  else
    return result;
}
bool check(pair<int, pair<int, int> > a, pair<int, pair<int, int> > b) {
  return a.second.second < b.second.second;
}
void update(int p, int v) {
  while (p <= n) {
    tree[p] = (tree[p] ^ v);
    p += (p & (-p));
  }
}
int getsum(int p) {
  int res = 0;
  while (p > 0) {
    res = (res ^ tree[p]);
    p -= (p & (-p));
  }
  return res;
}
int main() {
  int i, j, k, l, q;
  n = readInt();
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] ^ a[i];
  }
  q = readInt();
  for (i = 0; i < q; i++) {
    query[i].second.first = readInt();
    query[i].second.second = readInt();
    query[i].first = i;
  }
  sort(query, query + q, check);
  k = 0;
  int an = 0;
  i = 1;
  for (j = 0; j < q; j++) {
    for (; i <= query[j].second.second; i++) {
      if (last[a[i]]) update(last[a[i]], a[i]);
      update(i, a[i]);
      last[a[i]] = i;
    }
    an = getsum(query[j].second.second) ^ getsum(query[j].second.first - 1);
    an = an ^ sum[query[j].second.first - 1] ^ sum[query[j].second.second];
    ans[query[j].first] = an;
  }
  for (i = 0; i < q; i++) printf("%d\n", ans[i]);
  return 0;
}
