#include using namespace std; int main(){ string a,b;cin>>a>>b; if(a.size() != b.size()){ cout << (a.size() i; i++){ if(a[i] != b[i]){ if(a[i]=='4' && b[i] == '7'){ cout << a << endl; return 0; }else if(a[i] =='7' && b[i] == '4'){ cout << b << endl; return 0; }else if(a[i] > b[i]){ cout << a << endl; return 0; }else{ cout << b << endl; return 0; } } } } }