#include <iostream>

using namespace std;

int main()
{
    int N;
    cin>>N;
    int A[N],B[N],R[N],L[N],rez;
    for(int i=0;i<N;i++)
    {
        cin>>A[i];
        cin>>B[i];
        rez=(L[i]^R[i])*(L[i]&R[i]);
    }
    cout<<rez<<endl;

}