#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const int maxn = 1e6;
const int INF = 0x7fffffff;
const int mod = 1e9 + 7;
const double eps = 1e-7;
const double Pi = acos(-1.0);
inline int read_int() {
  char c;
  int ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
inline long long read_ll() {
  char c;
  long long ret = 0, sgn = 1;
  do {
    c = getchar();
  } while ((c < '0' || c > '9') && c != '-');
  if (c == '-')
    sgn = -1;
  else
    ret = c - '0';
  while ((c = getchar()) >= '0' && c <= '9') ret = ret * 10 + (c - '0');
  return sgn * ret;
}
struct query {
  bool operator<(const query& rhs) const {
    return r == rhs.r ? l < rhs.l : r < rhs.r;
  }
  int l, r, id;
} q[maxn + 5];
int arr[maxn + 5], sum[maxn + 5], pos[maxn + 5];
int n, m, len, last[maxn + 5], p;
int c[maxn + 5], res[maxn + 5];
inline void add(int pos, int value) {
  for (int i = pos; i <= n; i += ((i) & (-(i)))) c[i] ^= value;
}
inline int Query(int pos) {
  int res = 0;
  for (int i = pos; i; i -= ((i) & (-(i)))) res ^= c[i];
  return res;
}
int main() {
  n = read_int();
  for (int i = 1; i <= n; ++i) pos[i] = arr[i] = read_int();
  for (int i = 1; i <= n; ++i) sum[i] = arr[i] ^ sum[i - 1];
  sort(pos + 1, pos + 1 + n);
  len = unique(pos + 1, pos + 1 + n) - pos - 1;
  for (int i = 1; i <= n; ++i)
    arr[i] = lower_bound(pos + 1, pos + 1 + len, arr[i]) - pos;
  m = read_int();
  for (int i = 1; i <= m; ++i)
    q[i].l = read_int(), q[i].r = read_int(), q[i].id = i;
  sort(q + 1, q + 1 + m);
  for (int i = 1; i <= m; ++i) {
    while (p < q[i].r) {
      int v = arr[p + 1];
      if (!last[v])
        add(p + 1, pos[v]), last[v] = p + 1;
      else {
        add(last[v], pos[v]);
        add(p + 1, pos[v]);
        last[v] = p + 1;
      }
      ++p;
    }
    res[q[i].id] =
        sum[q[i].r] ^ sum[q[i].l - 1] ^ Query(q[i].r) ^ Query(q[i].l - 1);
  }
  for (int i = 1; i <= m; ++i) printf("%d\n", res[i]);
  return 0;
}
