#include #include #include int comp(char a,char b){ if(a=='4'&&b=='7')return 1; return a>b; } using namespace std; int main() { string A,B,_A,_B; cin>>A>>B; _A=A;_B=B; int n=max(A.size(),B.size()); reverse(A.begin(),A.end()); reverse(B.begin(),B.end()); for(int i = A.size(); i < n; i++)A+="0"; for(int i = B.size(); i < n; i++)B+="0"; reverse(A.begin(),A.end()); reverse(B.begin(),B.end()); for(int i = 0; i < n; i++){ if(comp(A[i],B[i])){ cout<<_A<