package _4_9_test;
import java.util.Scanner;
/*比较字符串
*
* */
public class EightyOne {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner scanner = new Scanner(System.in);
String s1 = scanner.next();
String s2 = scanner.next();
char c1[] = s1.toCharArray();
char c2[] = s2.toCharArray();
boolean flag = true;
int result = 0;
for (int i = 0; i < Math.min(c1.length, c2.length); i++) {
if (c1[i] != c2[i]) {
flag = false;
result = c1[i] - c2[i];
System.out.println(result);
break;
}
}
if (flag) {
System.out.println("0");
}
}
}