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