#include #include void solve() { std::string s; std::cin >> s; int n = s.length(); std::string t(n, '0'); for (int i = 0; i < n; ++i) { if (s[i] != '7') continue; s[i] = '3'; t[i] = '4'; } std::cout << std::stoi(s) << " " << std::stoi(t) << std::endl; } int main() { std::cin.tie(nullptr); std::ios::sync_with_stdio(false); solve(); return 0; }