#include #include int main(void) { char A[11], B[11]; int A_length, B_length, i; scanf("%s%s", A, B); A_length = strlen(A); B_length = strlen(B); if (A_length > B_length) puts(A); else if (A_length < B_length) puts(B); else { for (i = 0; i < A_length; ++i) { if (A[i] == '4' && B[i] == '7') { puts(A); break; } else if (A[i] == '7' && B[i] == '4') { puts(B); break; } else if (A[i] > B[i]) { puts(A); break; } else if (A[i] < B[i]) { puts(B); break; } } } return 0; }