#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7;
const int N = 1e6 + 5;
int n, m, a[N], Xor[N], nxt[N], ans[N];
struct Query {
  int l, r, id;
  bool operator<(const Query &rhs) const { return l < rhs.l; }
} q[N];
int d[N];
void add(int i, int c) {
  for (; i <= n; i += i & -i) d[i] ^= c;
}
int sum(int i) {
  int res = 0;
  for (; i; i -= i & -i) res ^= d[i];
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), Xor[i] = Xor[i - 1] ^ a[i];
  map<int, int> mp;
  for (int i = 1; i <= n; ++i)
    if (!mp[a[i]]) add(i, a[i]), mp[a[i]] = 1;
  mp.clear();
  for (int i = n; i >= 1; --i) {
    nxt[i] = mp[a[i]];
    mp[a[i]] = i;
  }
  scanf("%d", &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &q[i].l, &q[i].r);
    q[i].id = i;
  }
  sort(q + 1, q + m + 1);
  int l = 0;
  for (int i = 1; i <= m; ++i) {
    while (l < q[i].l) {
      if (nxt[l]) add(nxt[l], a[l]);
      l++;
    }
    ans[q[i].id] =
        sum(q[i].r) ^ sum(q[i].l - 1) ^ Xor[q[i].r] ^ Xor[q[i].l - 1];
  }
  for (int i = 1; i <= m; ++i) printf("%d\n", ans[i]);
}
