#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:1024000000,1024000000")
using namespace std;
const double pi = acos(-1.0), eps = 1e-8;
void File() {
  freopen("D:\\in.txt", "r", stdin);
  freopen("D:\\out.txt", "w", stdout);
}
const int maxn = 1000010;
int T, n;
int a[maxn], c[maxn], sum[maxn], Ans[maxn];
struct X {
  int id, L, R;
  long long ans;
} q[maxn];
bool cmp(X a, X b) { return a.R < b.R; }
bool cmp1(X a, X b) { return a.id < b.id; }
int lowbit(int x) { return x & (-x); }
void update(int p, long long v) {
  while (p <= n) c[p] = c[p] ^ v, p = p + lowbit(p);
}
int XOR(int p) {
  int res = 0;
  while (p > 0) res = res ^ c[p], p = p - lowbit(p);
  return res;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), sum[i] = sum[i - 1] ^ a[i];
  map<int, int> m;
  int Q;
  scanf("%d", &Q);
  for (int i = 1; i <= Q; i++) scanf("%d%d", &q[i].L, &q[i].R), q[i].id = i;
  sort(q + 1, q + 1 + Q, cmp);
  int p = 1;
  for (int i = 1; i <= n; i++) {
    int h = m[a[i]];
    if (h != 0) update(h, a[i]);
    update(i, a[i]);
    m[a[i]] = i;
    while (p <= Q && q[p].R == i) q[p].ans = XOR(q[p].R) ^ XOR(q[p].L - 1), p++;
  }
  for (int i = 1; i <= Q; i++)
    Ans[q[i].id] = sum[q[i].R] ^ sum[q[i].L - 1] ^ q[i].ans;
  for (int i = 1; i <= Q; i++) printf("%d\n", Ans[i]);
  return 0;
}
