import java.math.BigInteger; import java.util.*; class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String A = sc.next(); BigInteger a = new BigInteger(sc.next()); String X = sc.next(); String B = sc.next(); BigInteger b = new BigInteger(sc.next()); X = sc.next(); if(a.compareTo(b) == 1) { System.out.println(A); } else if(a.compareTo(b) == -1) { System.out.println(B); } else { System.out.println(-1); } } }