//http://www.cnblogs.com/bo-tao/archive/2012/04/16/2452633.html
#include<stdio.h>
#include<math.h>int main() {
int a,b,c;
while(scanf("%d%d",&a,&b)!=EOF) {
if(a<b) {c=a;a=b;b=c;}
c=a-b;
a=(int)(1.0*c*(1+1.0*sqrt(5.0))/2);
if(a==b)
printf("0\n");
else
printf("1\n");
}
return 0;
}