while 1:x,y,c,d,e,f,g,h=map(int,raw_input().split());a=x-c;b=y-d;c-=e;d-=f;e-=g;f-=h;g-=x;h-=y;print'10'[e*g+f*h<(a*c+b*d)*(e*h-f*g)/(b*c-a*d)]