#include <iostream>
#include <cmath>
using std::cin;
using std::cout;
using std::endl;
int main(int argc, char *argv[])
{
double x = (1.0f+sqrt(5.0f))/2.0f;
cout<<x<<endl;
int a,b,n;
while(cin>>a>>b){
if(a==b){
if(a == 0)
cout<<0<<endl;
else
cout<<1<<endl;
continue;
}
else if(a>b){
int t = a;
a = b;
b = t;
}
n = b - a;
if(a == int(x*n))
cout<<0<<endl;
else
cout<<1<<endl;
}
return 0;
}
#include <cmath>
using std::cin;
using std::cout;
using std::endl;
int main(int argc, char *argv[])
{
double x = (1.0f+sqrt(5.0f))/2.0f;
cout<<x<<endl;
int a,b,n;
while(cin>>a>>b){
if(a==b){
if(a == 0)
cout<<0<<endl;
else
cout<<1<<endl;
continue;
}
else if(a>b){
int t = a;
a = b;
b = t;
}
n = b - a;
if(a == int(x*n))
cout<<0<<endl;
else
cout<<1<<endl;
}
return 0;
}