#include<cstdio>
#include<vector>
using namespace std;
vector<int> p[100100];
int l[100100]={0};
void f(int x)
{
l[x]=-1;
for (int j=0;j<p[x].size();j++)
{
l[p[x][j]]--;
if (l[p[x][j]]<3&&l[p[x][j]]>=0) f(p[x][j]);
}
return;
}
int main()
{
freopen("asm_game.in","r",stdin);
freopen("asm_game.out","w",stdout);
int n,m;
scanf("%d%d",&n,&m);
for (int i=1;i<=m;i++)
{
int u,v;
scanf("%d%d",&u,&v);
p[u].push_back(v);
p[v].push_back(u);
l[u]++;
l[v]++;
}
for (int i=1;i<=n;i++)
if (l[i]<3) f(i);
long long ans=0;
for (int i=1;i<=n;i++)
if (l[i]>=3) ans=ans^i;
printf("%d",ans);
}