package net.ipipip0129.yukicoder.no201; import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String[] data = scan.nextLine().split(" "); String p1_name = data[0]; String p1_point = data[1]; data = scan.nextLine().split(" "); String p2_name = data[0]; String p2_point = data[1]; scan.close(); int result = -1; if (p1_point.length() == p2_point.length()) { for (int i = 0; i < p1_point.length(); i++) { if (Integer.parseInt(String.valueOf(p1_point.charAt(i))) < Integer.parseInt(String.valueOf(p2_point.charAt(i)))) { result = 1; break; } else if (Integer.parseInt(String.valueOf(p1_point.charAt(i))) > Integer.parseInt(String.valueOf(p2_point.charAt(i)))) { result = 0; break; } } } else if(p1_point.length() < p2_point.length()) { result = 1; } else { result = 0; } switch (result) { case -1: System.out.println(-1); break; case 0: System.out.println(p1_name); break; case 1: System.out.println(p2_name); break; } } }