#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000100;
struct seg {
  seg *fe, *fd;
  int meio, l, r, xo;
  seg(int x, int y) {
    l = x, r = y;
    meio = (x + y) / 2;
    xo = 0;
    if (l == r) return;
    fe = new seg(x, meio);
    fd = new seg(meio + 1, y);
  }
  void up(int pos, int novo) {
    if (l == r) {
      xo = novo;
      return;
    }
    if (pos <= meio)
      fe->up(pos, novo);
    else
      fd->up(pos, novo);
    xo = (fe->xo ^ fd->xo);
  }
  int get(int a, int b) {
    if (l >= a && r <= b) return xo;
    if (l > b || r < a) return 0;
    return (fe->get(a, b) ^ fd->get(a, b));
  }
};
seg st(1, MAXN);
seg ss(1, MAXN);
struct query {
  int l, r, id;
};
query q[MAXN];
int resp[MAXN];
int v[MAXN];
bool comp1(query a, query b) { return a.r < b.r; }
int main() {
  int n;
  scanf("%d", &n);
  map<int, int> mapa;
  for (int i = 1; i <= n; i++) scanf("%d", &v[i]), ss.up(i, v[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 + m + 1, comp1);
  int p = 1;
  for (int i = 1; i <= n; i++) {
    int h = mapa[v[i]];
    if (mapa[v[i]] != 0) st.up(h, 0);
    mapa[v[i]] = i;
    st.up(i, v[i]);
    while (p <= m && q[p].r <= i) {
      int r1 = ss.get(q[p].l, q[p].r);
      int r2 = st.get(q[p].l, q[p].r);
      resp[q[p].id] = (r1 ^ r2);
      p++;
    }
  }
  for (int i = 1; i <= m; i++) printf("%d\n", resp[i]);
}
