#include #include int main(void){ char s[11],t[11]; int num,i; scanf("%s %s",s,t); if(strlen(s)>strlen(t)) puts(s); else if(strlen(t)>strlen(s)) puts(t); else{ for(i=0;it[i]){ if(!(s[i]=='7' && t[i]=='4')){ puts(s); goto end; } else{ puts(t); goto end; } }else if(s[i]=='4' && t[i]=='7'){ puts(s); goto end; }else if(t[i]>s[i]){ if(!(t[i]=='7' && s[i]=='4')){ puts(t); goto end; }else{ puts(s); goto end; } }else if(t[i]=='4' && s[i]=='7'){ puts(t); goto end; } } } puts(t); end: num=1; return 0; }