import java.io.File; import java.util.*; public class Main { public static void main(String[] args){ // TODO 自動生成されたメソッド・スタブ Scanner sc = new Scanner(System.in); String aname = sc.next(); String ate = sc.next(); String atee = sc.next(); String bname = sc.next(); String bte = sc.next(); String btee = sc.next(); if(ate.length()>bte.length()){ System.out.println(aname); }else if(ate.length()bte.charAt(i)){ System.out.println(aname); return; }else if(ate.charAt(i)