#include #define PB push_back #define MP make_pair #define REP(i,n) for (int i=0;i<(n);i++) #define FOR(i,a,b) for(int i=(a);i<(b);i++) #define ALL(a) (a).begin(),(a).end() using namespace std; typedef long long ll; typedef unsigned long long ull; typedef pair P; const int INF=1e9; bool rec(string a,string b){ if(a.size()!=b.size())return a.size()>b.size(); REP(i,a.size()){ if(a[i]!=b[i]){ if(a[i]==4&&b[i]==7)return true; else if(b[i]==7&&b[i]==4)return false; return a[i]>b[i]; } } } int main(){ string a,b; cin>>a>>b; if(rec(a,b))cout<