#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e9 + 7;
const long long BINF = 4e18;
const int INF = 2e9;
const int MAX = 1e6;
const int MV = 1e5;
const double PI = 3.14159265358979323846;
int MA = -INF, MI = INF;
int PO(int x, int y) {
  if (y == 0) return 1;
  int ans = PO(x, y / 2);
  ans *= ans, ans %= MOD;
  if (y % 2 == 1) ans *= x, ans %= MOD;
  return ans % MOD;
}
void RE(int x) {
  x %= MOD;
  if (x < 0) x += MOD;
}
int odd[MAX + 10], seg[4 * MAX + 5], ans[MAX + 5];
int n, q, arr[MAX + 10];
map<int, int> last;
vector<pair<int, int> > que[MAX + 10];
void upd(int id, int b, int e, int p) {
  if (e - b == 1) {
    seg[id] ^= arr[p];
    return;
  }
  int mid = (b + e) / 2;
  if (p < mid)
    upd(id * 2, b, mid, p);
  else
    upd(id * 2 + 1, mid, e, p);
  seg[id] = seg[id * 2] ^ seg[id * 2 + 1];
  return;
}
int get(int id, int b, int e, int l, int r) {
  if (r <= b || e <= l) return 0;
  if (l <= b && e <= r) return seg[id];
  int mid = (b + e) / 2;
  return get(id * 2, b, mid, l, r) ^ get(id * 2 + 1, mid, e, l, r);
}
int32_t main() {
  ios::sync_with_stdio(0), cin.tie(0), cout.tie(0),
      cout << fixed << setprecision(10);
  cin >> n;
  for (int i = 1; i <= n; i++) cin >> arr[i], odd[i] = odd[i - 1] ^ arr[i];
  cin >> q;
  for (int i = 1; i <= q; i++) {
    int l, r;
    cin >> l >> r;
    que[r].push_back({l, i});
  }
  for (int i = 1; i <= n; i++) {
    if (last[arr[i]]) upd(1, 1, n + 1, last[arr[i]]);
    last[arr[i]] = i;
    upd(1, 1, n + 1, last[arr[i]]);
    for (pair<int, int> u : que[i])
      ans[u.second] =
          odd[i] ^ odd[u.first - 1] ^ get(1, 1, n + 1, u.first, i + 1);
  }
  for (int i = 1; i <= q; i++) cout << ans[i] << "\n";
  return 0;
}
