#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 7;
int sum[N << 2], M, n, a[N], m, s[N], ans[N];
void build() {
  M = 1;
  while (M - 2 < n) M <<= 1;
}
void pushup(int k) {
  for (k >>= 1; k; k >>= 1) sum[k] = sum[k << 1] ^ sum[k << 1 | 1];
}
void modify(int k, int val) {
  k += M;
  sum[k] ^= val;
  pushup(k);
}
int query(int l, int r) {
  int res = 0;
  for (l += M - 1, r += M + 1; l ^ r ^ 1; l >>= 1, r >>= 1) {
    if (~l & 1) res ^= sum[l ^ 1];
    if (r & 1) res ^= sum[r ^ 1];
  }
  return res;
}
struct data {
  int l, r, id;
  friend bool operator<(data a, data b) { return a.r < b.r; }
} data[N];
int main() {
  scanf("%d", &n);
  build();
  for (int i = 1; i <= n; ++i) scanf("%d", &a[i]), s[i] = s[i - 1] ^ a[i];
  map<int, int> vis;
  scanf("%d", &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &data[i].l, &data[i].r);
    data[i].id = i;
  }
  sort(data + 1, data + m + 1);
  int pos = 1;
  for (int i = 1; i <= n; ++i) {
    if (vis[a[i]]) modify(vis[a[i]], a[i]);
    modify(i, a[i]);
    vis[a[i]] = i;
    while (pos <= m && data[pos].r <= i) {
      ans[data[pos].id] =
          query(data[pos].l, data[pos].r) ^ s[data[pos].r] ^ s[data[pos].l - 1];
      pos++;
    }
  }
  for (int i = 1; i <= m; ++i) printf("%d\n", ans[i]);
  return 0;
}
