import java.util.Scanner; public class Main{ public static void main(String[] args){ Scanner sc=new Scanner(System.in); while(sc.hasNext()){ String a=sc.next(); String b=sc.next(); if(a.length()>b.length()) System.out.println(a); else if(a.length()kb){ if(ka==7 && kb==4) System.out.println(b); else System.out.println(a); } else{ if(kb==7 && ka==4) System.out.println(a); else System.out.println(b); } break; } } } } } }