#include<bits/stdc++.h>
using namespace std;

const int N = 100005;
const int A = 1000000;

int a[N];
int cnt[A + 1];
int n;

map<int,int> mp;

int sub1()
{
    for(int i = 1; i <= n; i++)
    {
        cnt[a[i]]++;
    }

    for(int i = 0; i <= A; i++)
    {
        if(cnt[i] % 2 == 1)
            return i;
    }
}

int sub2_solve1()
{
    for(int i = 1; i <= n; i++)
    {
        mp[a[i]]++;
    }

    for(pair<int,int> x:mp)
    {
        if(x.second % 2 == 1)
            return x.first;
    }
}

int sub2_solve2()
{
    sort(a + 1, a + 1 + n);

    int cnt = 1;
    for (int i = 2; i <= n; i++)
    {
        if (a[i] == a[i - 1])
        {
            ++cnt;
        }

        else
        {
            if (cnt % 2 == 1) return a[i - 1];
            cnt = 1;
        }
    }

    if (cnt % 2 == 1) return a[n];
}

int sub2_solve3()
{
    int ans = 0;

    for(int i = 1; i <= n; i++)
    {
        ans ^= a[i];
    }

    return ans;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    freopen("CHIECGIAY.INP", "r", stdin);
    freopen("CHIECGIAY.OUT", "w", stdout);
    cin >> n;
    int MaxA = -1;
    for(int i = 1; i <= n; i++)
    {
        cin >> a[i];
        MaxA = max(MaxA, a[i]);
    }

    if (MaxA <= 1e6) cout<<sub1();
    else cout<<sub2_solve3();

    return 0;
}
