// No.293 4>7の世界 // https://yukicoder.me/problems/no/293 // #include #include #include using namespace std; class number { public: string val; bool operator<(number other) { if (val.size() > other.val.size()) return false; if (val.size() < other.val.size()) return true; for (auto i = 0; i < val.size(); ++i) { if (val[i] != other.val[i]) { if (val[i] == '4' && other.val[i] == '7' || val[i] == '7' && other.val[i] == '4') return !(val[i] < other.val[i]); else return val[i] < other.val[i]; } } return false; } }; template basic_ostream& operator<<(basic_ostream& os, number& s) { os << s.val; return os; } template basic_istream& operator>>(basic_istream& is, number& s) { is >> s.val; return is; }; int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); number A, B; cin >> A >> B; if (A < B) cout << B << endl; else cout << A << endl; }