#include<iostream>
using namespace std;
int main()
{
int i=0,x1,y1,x2,y2,x,y,a1,a2,b1,b2;
int h[10000];
cin>>x>>y>>x1>>y1>>x2>>y2;
while((x+y+x1+y1+x2+y2)!=0)
{
a1=x1-x;
b1=y1-y;
a2=x2-x;
b2=y2-y;
if((a1*b2-a2*b1)<0)
h[i]=1;
else
h[i]=0;
cin>>x>>y>>x1>>y1>>x2>>y2;
i++;
}
for(int j=0;j<i;j++)
cout<<h[j]<<endl;
return 0;
}