#include <bits/stdc++.h>
using namespace std;
int n, m, a[1000005], ans[1000005], q[1000005], XOR[1000005];
struct node {
  int l, r, id;
} p[1000005];
int lowbit(int x) { return x & (-x); }
void update(int x, int val) {
  for (; x != 0 && x <= n; x += lowbit(x)) q[x] ^= val;
}
int sum(int x) {
  int ans = 0;
  for (; x > 0; x -= lowbit(x)) ans ^= q[x];
  return ans;
}
map<int, int> pre;
bool cmp(const node& x, const node& y) { return x.r < y.r; }
int main() {
  cin >> n;
  for (int i = 1; i <= n; i++) {
    scanf("%d", &a[i]);
    XOR[i] = XOR[i - 1] ^ a[i];
  }
  cin >> m;
  for (int i = 0; i < m; i++) {
    scanf("%d %d", &p[i].l, &p[i].r);
    p[i].id = i;
  }
  sort(p, p + m, cmp);
  int cnt = 1;
  for (int i = 0; i < m; i++) {
    for (; cnt <= p[i].r; cnt++) {
      update(pre[a[cnt]], a[cnt]);
      update(cnt, a[cnt]);
      pre[a[cnt]] = cnt;
    }
    ans[p[i].id] = sum(p[i].r) ^ (p[i].l == 1 ? 0 : sum(p[i].l - 1));
    ans[p[i].id] ^= XOR[p[i].r] ^ XOR[p[i].l - 1];
  }
  for (int i = 0; i < m; i++) printf("%d\n", ans[i]);
}
