#include using namespace std; int main (){ cin.tie(0); ios::sync_with_stdio(false); vector N(2); string R1,R2,P1,P2; cin >> N[0] >> R1 >> P2 >> N[1] >> R2 >> P2; cout << ( R1 == R2 ? "-1" : N[ R1.size() > R2.size() || ( R1.size() == R2.size() && R1 > R2 ) ? 0 : 1 ] ) << endl; return 0; }