#include #include using namespace std; int main() { string s1; string s2; cin >> s1 >> s2; if (s1.length() > s2.length()) { cout << s1 << endl; } else if (s1.length() < s2.length()) { cout << s2 << endl; } for (int i = 0; i < s1.length(); ++i) { if (s1[i] == s2[i]) { continue; } if (s1[i] > s2[i]) { if (s1[i] == '7' && s2[i] == '4') { cout << s2 << endl; } else { cout << s1 << endl; } } else { if (s1[i] == '4' && s2[i] == '7') { cout << s1 << endl; } else { cout << s2 << endl; } } } }