#include<stdio.h>
#include<math.h>
int main()
{
int n,m;
while(scanf("%d%d",&n,&m)!=EOF)
{
int t,k;
if(n>m)
{
t=n;
n=m;
m=t;
}
t=m-n;
k=floor(t*(1+sqrt(5.0))/2);
if(m==k+t) printf("0\n");
else printf("1\n");
}
return 0;
}
#include<math.h>
int main()
{
int n,m;
while(scanf("%d%d",&n,&m)!=EOF)
{
int t,k;
if(n>m)
{
t=n;
n=m;
m=t;
}
t=m-n;
k=floor(t*(1+sqrt(5.0))/2);
if(m==k+t) printf("0\n");
else printf("1\n");
}
return 0;
}