#include <bits/stdc++.h>
using namespace std;
inline long long rd() {
  long long x = 0, f = 1;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (isdigit(c)) {
    x = (x << 1) + (x << 3) + (c ^ 48);
    c = getchar();
  }
  return x * f;
}
const int N = 1e6 + 7;
int val[N << 2];
void add(int p, int l, int r, int x, int y) {
  if (l == r) {
    val[p] = y;
    return;
  }
  int mid = (l + r) >> 1;
  if (x <= mid)
    add(p << 1, l, mid, x, y);
  else
    add(p << 1 | 1, mid + 1, r, x, y);
  val[p] = val[p << 1] ^ val[p << 1 | 1];
}
int get(int p, int l, int r, int x, int y) {
  if (x <= l && y >= r) return val[p];
  int mid = (l + r) >> 1, a = 0, b = 0;
  if (x <= mid) a = get(p << 1, l, mid, x, y);
  if (y > mid) b = get(p << 1 | 1, mid + 1, r, x, y);
  return a ^ b;
}
int a[N], sum[N], L[N], R[N], num[N], ans[N];
map<int, int> pos;
bool cmp(int c, int d) { return R[c] < R[d]; }
int main() {
  int n = rd(), m, last = 1;
  for (int i = 1; i <= n; i++) a[i] = rd(), sum[i] = sum[i - 1] ^ a[i];
  m = rd();
  for (int i = 1; i <= m; i++) L[i] = rd(), R[i] = rd(), num[i] = i;
  sort(num + 1, num + 1 + m, cmp);
  for (int i = 1; i <= m; i++) {
    int p = num[i];
    while (last <= R[p]) {
      if (pos[a[last]]) add(1, 1, n, pos[a[last]], 0);
      add(1, 1, n, last, a[last]), pos[a[last]] = last;
      last++;
    }
    ans[p] = get(1, 1, n, L[p], R[p]) ^ sum[R[p]] ^ sum[L[p] - 1];
  }
  for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
}
