import java.util.Scanner; public class Test { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String p1 = sc.next(), x = sc.next(); String p2 = sc.next(), y = sc.next(); if(p1.compareTo(p2) > 0){ System.out.println(p1); } else if(p1.compareTo(p2) < 0){ System.out.println(p2); } else { System.out.println(-1); } } }