#include<bits/stdc++.h> using namespace std; double a[5]; double a1,b1; int main(){ while(cin>>a[1]>>a[2]>>a[3]>>a[4]){ cin>>a[1]>>a[2]>>a[3]>>a[4]; for(int i=1;i<=4;i++){ if(a[i]>10) a[i]=0.5; } a1=a[1]+a[2],b1=a[3]+a[4]; if(a1>10.5) a1=0; if(b1>10.5) b1=0; if(a1>b1) cout<<1; if(a1=b1) cout<<0; if(a1<b1) cout<<-1; } return 0; }