package yukicoder; import java.math.BigInteger; import java.util.Scanner; public class Yuki201 { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String name = scan.next(); String point = scan.next(); String R = scan.next(); String name2 = scan.next(); String point2 = scan.next(); String R2 = scan.next(); scan.close(); BigInteger bigint = new BigInteger(point); BigInteger bigint2 = new BigInteger(point2); int ans = bigint.compareTo(bigint2); if(ans == 1){ System.out.println(name); }else if( ans == -1){ System.out.println(name2); }else { System.out.println(-1); } } }