#include <bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 10;
int a[maxn], fen[maxn], ans[maxn], n, q;
int sum[maxn];
struct node {
  int l, r, id;
} Q[maxn];
map<int, int> mm;
bool cmp(node &a, node &b) { return a.r < b.r; }
void update(int x, int val) {
  for (; x < maxn; x += x & -x) fen[x] ^= val;
}
int get(int x) {
  int ret = 0;
  for (; x; x -= x & -x) ret ^= fen[x];
  return ret;
}
inline void Query() {
  cin >> q;
  for (int i = 1; i <= q; i++) {
    cin >> Q[i].l >> Q[i].r;
    Q[i].id = i;
  }
  sort(Q + 1, Q + 1 + q, cmp);
}
inline void solve() {
  int p = 1;
  for (int i = 1; i <= q; i++) {
    while (p <= n && p <= Q[i].r) {
      if (mm[a[p]]) update(mm[a[p]], a[p]);
      update(p, a[p]);
      mm[a[p]] = p;
      p++;
    }
    ans[Q[i].id] =
        sum[Q[i].r] ^ sum[Q[i].l - 1] ^ get(Q[i].r) ^ get(Q[i].l - 1);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
  cin >> n;
  for (int i = 1; i <= n; i++) {
    cin >> a[i];
    sum[i] = sum[i - 1] ^ a[i];
  }
  Query();
  solve();
  for (int i = 1; i <= q; i++) cout << ans[i] << endl;
  return 0;
}
