#include <bits/stdc++.h>
int main() {
  char A[100], B[100];
  scanf("%s %s", A, B);
  int i, d, a, b;
  for (i = 0; i < strlen(A); i++) {
    a = A[i] > 96 ? A[i] % 96 : A[i] % 64;
    b = B[i] > 96 ? B[i] % 96 : B[i] % 64;
    d = a - b;
    if (d == 0 || d == 32 || d == -32)
      continue;
    else {
      if (d > 0)
        printf("1");
      else
        printf("-1");
      exit(0);
    }
  }
  printf("0");
}
