#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int arr[N], n, XOR[N], last[N], tr[N], ans[N];
struct Node {
  int l, r, id;
  friend bool operator<(const Node &a, const Node &b) { return a.r < b.r; }
} Q[N];
map<int, int> Hash;
int lowbit(int x) { return x & (-x); }
void add(int i, int val) {
  for (; i <= n; i += lowbit(i)) tr[i] ^= val;
}
int query(int i) {
  int res = 0;
  for (; i >= 1; i -= lowbit(i)) res ^= tr[i];
  return res;
}
int main() {
  scanf("%d", &n);
  Hash.clear();
  memset(last, 0, sizeof(last));
  for (int i = 1; i <= n; i++) {
    scanf("%d", &arr[i]);
    XOR[i] = XOR[i - 1] ^ arr[i];
    last[i] = Hash[arr[i]];
    Hash[arr[i]] = i;
  }
  int m;
  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);
  int px = 1;
  for (int i = 1; i <= n; i++) {
    if (last[i]) add(last[i], arr[i]);
    add(i, arr[i]);
    while (px <= m && Q[px].r == i) {
      ans[Q[px].id] = query(Q[px].r) ^ query(Q[px].l - 1);
      ans[Q[px].id] ^= XOR[Q[px].r] ^ XOR[Q[px].l - 1];
      px++;
    }
  }
  for (int i = 1; i <= m; i++) printf("%d\n", ans[i]);
  return 0;
}
