#include <bits/stdc++.h>
using namespace std;
const int N = 3002001;
inline int scan() {
  char c = getchar();
  int x = 0;
  while (c < '0' || c > '9') {
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = (x << 1) + (x << 3) + c - '0';
    c = getchar();
  }
  return x;
}
long long int add(long long int a, long long int b) {
  return a + b - (a + b >= 1000000007) * 1000000007;
}
long long int sub(long long int a, long long int b) {
  return a - b + (a - b < 0) * 1000000007;
}
long long int mult(long long int a, long long int b) {
  return (1LL * a * b) % 1000000007;
}
inline long long int gcd(long long int a, long long int b) {
  long long int t;
  while (b) {
    a = a % b;
    t = a;
    a = b;
    b = t;
  }
  return a;
}
long long int exponentmod(long long int a, long long int b) {
  long long int res = 1;
  a %= 1000000007;
  assert(b >= 0);
  for (; b; b >>= 1) {
    if (b & 1) res = res * a % 1000000007;
    a = a * a % 1000000007;
  }
  return res;
}
int bin_1(long long int x) {
  int r = 0;
  while (x) {
    r++;
    x &= x - 1;
  }
  return r;
}
long long int modpow(long long int b, long long int e, long long int m) {
  long long int r = 1;
  b = b % m;
  while (e > 0) {
    if (e % 2 == 1) r = (r * b) % m;
    e /= 2;
    b = (b * b) % m;
  }
  return r;
}
long long int modinverse(long long int a) {
  return modpow(a, 1000000007 - 2, 1000000007);
}
long long int nCrmod(long long int n, long long int r, long long int m) {
  if (r > n) r = n - r;
  long long int res = 1;
  for (long long int i = r; i >= 1; i--) {
    res = (res * (n - i + 1)) % m;
    res = (res * modinverse(i));
  }
  return res;
}
long long int power(long long int b, long long int e) {
  if (e == 0) return 1;
  if (e % 2 == 0) return power(b * b, e / 2);
  return b * power(b * b, e / 2);
}
double powerf(double b, int e) {
  if (e == 0) return 1;
  if (e % 2 == 0)
    return powerf(b * b, e / 2);
  else {
    if (e > 0)
      return b * powerf(b * b, e / 2);
    else
      return powerf(b * b, e / 2) / b;
  }
}
const int sievesize = (long long int)1e6 + 10;
bool prime[sievesize + 1];
void sieve() {
  long long int x, y;
  prime[0] = prime[1] = true;
  for (x = 2; x * x <= sievesize; x++) {
    if (!prime[x])
      for (y = x * x; y <= sievesize; y += x) prime[y] = true;
  }
}
long long int nextPowerOf2(long long int n) {
  n--;
  n |= n >> 1;
  n |= n >> 2;
  n |= n >> 4;
  n |= n >> 8;
  n |= n >> 16;
  n++;
  return n;
}
bool isPerfectSquare(long long int n) {
  if (n < 0) return false;
  long long int tst = (long long int)(sqrt(n) + 0.5);
  return tst * tst == n;
}
bool triangle(long long int a, long long int b, long long int c) {
  return ((a + b) > c && (b + c) > a && (a + c) > b);
}
long long int chartoint(char c) {
  switch (c) {
    case '1':
      return 1;
      break;
    case '2':
      return 2;
      break;
    case '3':
      return 3;
      break;
    case '4':
      return 4;
      break;
    case '5':
      return 5;
      break;
    case '6':
      return 6;
      break;
    case '7':
      return 7;
      break;
    case '8':
      return 8;
      break;
    case '9':
      return 9;
      break;
    default:
      return 0;
      break;
  }
}
long long int isnum(char s) {
  if (s == '1' || s == '2' || s == '3' || s == '4' || s == '5' || s == '6' ||
      s == '7' || s == '8' || s == '9' || s == '0')
    return 1;
  return 0;
}
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
int n;
int arr[N];
int pre[N];
int q;
int l, r;
vector<pair<int, int> > v[N];
int ans[N];
int bit[N];
map<int, int> mp;
void update(int idx, int val) {
  while (idx) {
    bit[idx] ^= val;
    idx -= idx & -idx;
  }
}
int query(int idx) {
  int res = 0;
  while (idx <= n) {
    res ^= bit[idx];
    idx += idx & -idx;
  }
  return res;
}
int main() {
  scanf("%d", &n);
  pre[0] = 0;
  for (int i = 1; i <= n; ++i) {
    scanf("%d", arr + i);
    pre[i] = pre[i - 1] ^ arr[i];
  }
  scanf("%d", &q);
  for (int i = 1; i <= q; ++i) {
    scanf("%d %d", &l, &r);
    v[r].emplace_back(make_pair(l, i));
  }
  mp.clear();
  for (int i = 1; i <= n; ++i) {
    if (mp.find(arr[i]) != mp.end()) {
      update(mp[arr[i]], arr[i]);
    }
    update(i, arr[i]);
    for (auto it : v[i]) {
      ans[it.second] = pre[i] ^ pre[it.first - 1] ^ query(it.first);
    }
    mp[arr[i]] = i;
  }
  for (int i = 1; i <= q; ++i) {
    printf("%d\n", ans[i]);
  }
  return 0;
}
