#include <bits/stdc++.h>
using namespace std;
const int maxn = 1000010;
int n, m;
int a[maxn];
map<int, int> vis;
struct Q {
  int l, r;
  int id;
  bool operator<(const Q& a) const { return r < a.r; }
} q[1001000];
int ans[1000100];
struct IntervalTree {
  int sum[maxn << 3];
  void build() { memset(sum, 0, sizeof(sum)); }
  void update(int o, int l, int r, int pos, int val) {
    if (l == r) {
      sum[o] ^= val;
      return;
    }
    int mid = (l + r) >> 1;
    if (pos <= mid)
      update(o << 1, l, mid, pos, val);
    else
      update(o << 1 | 1, mid + 1, r, pos, val);
    sum[o] = sum[o << 1] ^ sum[o << 1 | 1];
  }
  int query(int o, int l, int r, int q1, int q2) {
    if (q1 <= l && r <= q2) return sum[o];
    int mid = (l + r) >> 1;
    int ans = 0;
    if (q1 <= mid) ans ^= query(o << 1, l, mid, q1, q2);
    if (q2 > mid) ans ^= query(o << 1 | 1, mid + 1, r, q1, q2);
    return ans;
  }
} tree;
namespace G {
int val[1000010 * 4];
void build(int o, int l, int r) {
  if (l == r) {
    val[o] = a[l];
    return;
  }
  int mid = l + r >> 1;
  build(o << 1, l, mid);
  build(o << 1 | 1, mid + 1, r);
  val[o] = val[o << 1] ^ val[o << 1 | 1];
}
int query(int o, int l, int r, int st, int ed) {
  if (st <= l && r <= ed) {
    return val[o];
  }
  int mid = l + r >> 1;
  int ret = 0;
  if (st <= mid) ret ^= query(o << 1, l, mid, st, ed);
  if (ed > mid) ret ^= query(o << 1 | 1, mid + 1, r, st, ed);
  return ret;
}
}  // namespace G
int main() {
  int T;
  {
    scanf("%d", &n);
    for (int i = 1; i <= n; i++) scanf("%d", &a[i]);
    G::build(1, 1, n);
    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 + 1 + m);
    vis.clear();
    tree.build();
    int cur = 1;
    for (int i = 1; i <= m; i++) {
      for (; cur <= n && cur <= q[i].r; cur++) {
        if (vis[a[cur]]) tree.update(1, 1, n, vis[a[cur]], a[cur]);
        tree.update(1, 1, n, cur, a[cur]);
        vis[a[cur]] = cur;
      }
      ans[q[i].id] = tree.query(1, 1, n, q[i].l, q[i].r) ^
                     G::query(1, 1, n, q[i].l, q[i].r);
    }
    for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
  }
  return 0;
}
