#include using namespace std; #define rep(i,a,b) for(int i=a;i> A >> B; if (A.length() < B.length()) { cout << B << endl; return 0; } if (B.length() < A.length()) { cout << A << endl; return 0; } rep(i, 0, A.length()) { if (A[i] == B[i]) continue; if (A[i] == '4' && B[i] == '7') { cout << A << endl; return 0; } if (A[i] == '7' && B[i] == '4') { cout << B << endl; return 0; } if (A[i] < B[i]) { cout << B << endl; return 0; } if (A[i] > B[i]) { cout << A << endl; return 0; } } }